expect_007.phpt 546 B

12345678910111213141516171819202122
  1. --TEST--
  2. test compiled reason
  3. --INI--
  4. zend.assertions=1
  5. assert.exception=1
  6. --FILE--
  7. <?php
  8. $next = 1;
  9. $data = array(
  10. "key" => "X-HTTP ",
  11. "value" => "testing"
  12. );
  13. class HeaderMalfunctionError extends AssertionError {}
  14. assert (preg_match("~^([a-zA-Z0-9-]+)$~", $data["key"]), new HeaderMalfunctionError("malformed key found at {$next} \"{$data["key"]}\""));
  15. ?>
  16. --EXPECTF--
  17. Fatal error: Uncaught HeaderMalfunctionError: malformed key found at 1 "X-HTTP " in %sexpect_007.php:10
  18. Stack trace:
  19. #0 {main}
  20. thrown in %sexpect_007.php on line 10