response-headers.php 315 B

123456789101112131415
  1. <?php
  2. require_once __DIR__.'/_executor.php';
  3. return function () {
  4. header('Foo: bar');
  5. header('Foo2: bar2');
  6. header('Invalid');
  7. header('I: ' . ($_GET['i'] ?? 'i not set'));
  8. if ($_GET['i'] % 3) {
  9. http_response_code($_GET['i'] + 100);
  10. }
  11. var_export(apache_response_headers());
  12. };