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)
243243
244244 ZEND_PARSE_PARAMETERS_START (3 , 3 )
245245 Z_PARAM_STR (source_string )
246- Z_PARAM_STR (filename )
246+ Z_PARAM_PATH_STR_EX (filename , 1 , 0 )
247247 Z_PARAM_LONG (position )
248248 ZEND_PARSE_PARAMETERS_END ();
249249
Original file line number Diff line number Diff line change 3838
3939zend_test_compile_string ($ source_string , 'Source string ' , ZEND_COMPILE_POSITION_AFTER_OPEN_TAG );
4040
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+
4153$ source_string = <<<EOF
4254<?php
4355var_dump('php');
4456EOF ;
4557
4658zend_test_compile_string ($ source_string , 'Source string ' , ZEND_COMPILE_POSITION_AFTER_OPEN_TAG );
59+
4760?>
4861--EXPECT--
4962string(3) "php"
5063#!/path/to/php
5164string(3) "php"
5265string(3) "php"
5366string(3) "php"
67+ zend_test_compile_string(): Argument #2 ($filename) must not contain any null bytes
5468
5569Parse 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