On Wed, Nov 20, 2013 at 12:47 AM, Yasuo Ohgaki wrote:
Hi all,
This PR seems good fix for 5.6.
https://github.com/php/php-src/pull/463
Test script:
---------------
$a = ''; // empty string
$a[10] = 'a';
echo $a; // "Array"
$b = ' '; // non empty string
$b[10] = 'b';
echo $b; // " b"
Expected result:
----------------
" a"
" b"
Actual result:
--------------
"Array"
" b"
Current behavior does not make sense.
Hi all,
This PR seems good fix for 5.6.
https://github.com/php/php-src/pull/463
Test script:
---------------
$a = ''; // empty string
$a[10] = 'a';
echo $a; // "Array"
$b = ' '; // non empty string
$b[10] = 'b';
echo $b; // " b"
Expected result:
----------------
" a"
" b"
Actual result:
--------------
"Array"
" b"
Current behavior does not make sense.
empty string) is silently cast to array when an array operation is applied
to it. I don't like that behavior, but it's somewhat internally consistent
now. Changing it for strings *only* seems a bit weird.
Nikita