summaryrefslogtreecommitdiff
path: root/Zend/tests/assert/expect_007.phpt
blob: 5b6aeffb4a4a39492663bac2cd9213305fb6df30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
test compiled reason
--INI--
zend.assertions=1
assert.exception=1
--FILE--
<?php
$next = 1;
$data = array(
    "key" => "X-HTTP ",
    "value" => "testing"
);

class HeaderMalfunctionException extends AssertionException {}

assert (preg_match("~^([a-zA-Z0-9-]+)$~", $data["key"]), new HeaderMalfunctionException("malformed key found at {$next} \"{$data["key"]}\""));
?>
--EXPECTF--
Fatal error: Uncaught exception 'HeaderMalfunctionException' with message 'malformed key found at 1 "X-HTTP "' in %sexpect_007.php:10
Stack trace:
#0 {main}
  thrown in %sexpect_007.php on line 10