php-src/Zend/tests/bug60569.phpt
Nikita Popov ea256a218b Add %0 format to run-tests.php
This format matches against null bytes, and prevents the test
expectation from being interpreted as binary data.

bless_tests.php will automatically replace \0 with %0 as well.
2021-05-29 11:33:13 +02:00

15 lines
300 B
PHP

--TEST--
Bug #60569 (Nullbyte truncates Exception $message.)
--FILE--
<?php
try {
$msg = "Some error \x00 message";
throw new Exception($msg);
} catch(Exception $e) {
var_dump($e->getMessage(), $msg);
}
?>
--EXPECTF--
string(20) "Some error %0 message"
string(20) "Some error %0 message"