php-src/Zend/tests/bug71572.phpt
Francois Laupretre be607e724c Fix bug #71572
Discussed on the internals list as part of
http://markmail.org/message/fa625yc2eegk2dio.
2016-02-14 13:18:23 +01:00

27 lines
599 B
PHP

--TEST--
Bug #71572: String offset assignment from an empty string inserts null byte
--FILE--
<?php
$str = "abc";
var_dump($str{0} = "");
var_dump($str{1} = "");
var_dump($str{3} = "");
var_dump($str{10} = "");
var_dump($str);
?>
==DONE==
--EXPECTF--
Warning: Cannot assign an empty string to a string offset in %s on line %d
NULL
Warning: Cannot assign an empty string to a string offset in %s on line %d
NULL
Warning: Cannot assign an empty string to a string offset in %s on line %d
NULL
Warning: Cannot assign an empty string to a string offset in %s on line %d
NULL
string(3) "abc"
==DONE==