Skip to content

Commit 8d1869d

Browse files
committed
add test
1 parent ee4bfb4 commit 8d1869d

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

ext/zend_test/tests/gh17797.phpt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--TEST--
2+
GH-17797 (zend_test_compile_string crash on invalid script path)
3+
--EXTENSIONS--
4+
zend_test
5+
--CREDITS--
6+
YuanchengJiang
7+
--FILE--
8+
<?php
9+
$source = '<?php
10+
require("sumfile.php");
11+
?>';
12+
try {zend_test_compile_string($source,$source,$c);} catch (Exception $e) { echo($e); }
13+
--EXPECTF--
14+
15+
Warning: Undefined variable $c in %s on line %d
16+
17+
Deprecated: zend_test_compile_string(): Passing null to parameter #3 ($position) of type int is deprecated in %s on line %d
18+
19+
Warning: require(sumfile.php): Failed to open stream: No such file or directory in <?php
20+
require("sumfile.php");
21+
?> on line %d
22+
23+
Fatal error: Uncaught Error: Failed opening required 'sumfile.php' (include_path='.:') in <?php
24+
require("sumfile.php");
25+
?>:%d
26+
Stack trace:
27+
#0 %s(%d): zend_test_compile_string('<?php\nrequire("...', '<?php\nrequire("...', NULL)
28+
#1 {main}
29+
thrown in <?php
30+
require("sumfile.php");
31+
?> on line %d

0 commit comments

Comments
 (0)