diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index bcc3351e0331..1d4c14dd07e3 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -243,7 +243,7 @@ static ZEND_FUNCTION(zend_test_compile_string) ZEND_PARSE_PARAMETERS_START(3, 3) Z_PARAM_STR(source_string) - Z_PARAM_STR(filename) + Z_PARAM_PATH_STR_EX(filename, 1, 0) Z_PARAM_LONG(position) ZEND_PARSE_PARAMETERS_END(); diff --git a/ext/zend_test/tests/zend_test_compile_string.phpt b/ext/zend_test/tests/zend_test_compile_string.phpt index f2449d86ffa2..c03c46b0100d 100644 --- a/ext/zend_test/tests/zend_test_compile_string.phpt +++ b/ext/zend_test/tests/zend_test_compile_string.phpt @@ -38,12 +38,25 @@ EOF; zend_test_compile_string($source_string, 'Source string', ZEND_COMPILE_POSITION_AFTER_OPEN_TAG); +$source_string = <<getMessage(), PHP_EOL; +} + + $source_string = << --EXPECT-- string(3) "php" @@ -51,5 +64,6 @@ string(3) "php" string(3) "php" string(3) "php" string(3) "php" +zend_test_compile_string(): Argument #2 ($filename) must not contain any null bytes Parse error: syntax error, unexpected token "<", expecting end of file in Source string on line 1