mirror of
https://github.com/php/php-src.git
synced 2024-12-14 04:16:30 +08:00
be607e724c
Discussed on the internals list as part of http://markmail.org/message/fa625yc2eegk2dio.
27 lines
599 B
PHP
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==
|