mirror of
https://github.com/php/php-src.git
synced 2024-12-13 20:05:26 +08:00
28 lines
600 B
PHP
28 lines
600 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==
|