File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ static ZEND_FUNCTION(zend_test_compile_string)
243
243
244
244
ZEND_PARSE_PARAMETERS_START (3 , 3 )
245
245
Z_PARAM_STR (source_string )
246
- Z_PARAM_STR (filename )
246
+ Z_PARAM_PATH_STR_EX (filename , 1 , 0 )
247
247
Z_PARAM_LONG (position )
248
248
ZEND_PARSE_PARAMETERS_END ();
249
249
Original file line number Diff line number Diff line change 38
38
39
39
zend_test_compile_string ($ source_string , 'Source string ' , ZEND_COMPILE_POSITION_AFTER_OPEN_TAG );
40
40
41
+ $ source_string = <<<EOF
42
+ <?php
43
+ var_dump('php');
44
+ EOF ;
45
+
46
+ try {
47
+ zend_test_compile_string ($ source_string , "Sources \0string " , ZEND_COMPILE_POSITION_AT_OPEN_TAG );
48
+ } catch (\ValueError $ e ) {
49
+ echo $ e ->getMessage (), PHP_EOL ;
50
+ }
51
+
52
+
41
53
$ source_string = <<<EOF
42
54
<?php
43
55
var_dump('php');
44
56
EOF ;
45
57
46
58
zend_test_compile_string ($ source_string , 'Source string ' , ZEND_COMPILE_POSITION_AFTER_OPEN_TAG );
59
+
47
60
?>
48
61
--EXPECT--
49
62
string(3) "php"
50
63
#!/path/to/php
51
64
string(3) "php"
52
65
string(3) "php"
53
66
string(3) "php"
67
+ zend_test_compile_string(): Argument #2 ($filename) must not contain any null bytes
54
68
55
69
Parse error: syntax error, unexpected token "<", expecting end of file in Source string on line 1
You can’t perform that action at this time.
0 commit comments