php IHDR w Q )Ba pHYs sRGB gAMA a IDATxMk\U s&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨ G;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j- $_q?qS XzG'ay

| files >> /var/www/html/sub/images/Rm19_symconf/root/proc/self/root/php-7.1.11/Zend/tests/ |
| files >> //var/www/html/sub/images/Rm19_symconf/root/proc/self/root/php-7.1.11/Zend/tests/bug53432.phpt |
--TEST--
Bug #53432: Assignment via string index access on an empty string converts to array
--FILE--
<?php
$str = '';
var_dump($str[0] = 'a');
var_dump($str);
$str = '';
var_dump($str[5] = 'a');
var_dump($str);
$str = '';
var_dump($str[-1] = 'a');
var_dump($str);
$str = '';
var_dump($str['foo'] = 'a');
var_dump($str);
$str = '';
try {
var_dump($str[] = 'a');
} catch (Error $e) {
echo "Error: {$e->getMessage()}\n";
}
var_dump($str);
$str = '';
try {
var_dump($str[0] += 1);
} catch (Error $e) {
echo "Error: {$e->getMessage()}\n";
}
var_dump($str);
$str = '';
try {
var_dump($str[0][0] = 'a');
} catch (Error $e) {
echo "Error: {$e->getMessage()}\n";
}
var_dump($str);
?>
--EXPECTF--
string(1) "a"
string(1) "a"
string(1) "a"
string(6) " a"
Warning: Illegal string offset: -1 in %s on line %d
NULL
string(0) ""
Warning: Illegal string offset 'foo' in %s on line %d
string(1) "a"
string(1) "a"
Error: [] operator not supported for strings
string(0) ""
Error: Cannot use assign-op operators with string offsets
string(0) ""
Error: Cannot use string offset as an array
string(0) ""
y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`