1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/standard/tests/array/bug26458.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

21 lines
391 B
PHP

--TEST--
Bug #26458 (var_dump(), var_export() & debug_zval_dump() are not binary safe for array keys)
--FILE--
<?php
$test = array("A\x00B" => "Hello world");
var_dump($test);
var_export($test);
debug_zval_dump($test);
?>
--EXPECTF--
array(1) {
["A%0B"]=>
string(11) "Hello world"
}
array (
'A' . "\0" . 'B' => 'Hello world',
)array(1) %s{
["A%0B"]=>
string(11) "Hello world" %s
}