ID: 32522 Updated by: [EMAIL PROTECTED] Reported By: php at alterego dot dp dot ua -Status: Open +Status: Bogus Bug Type: Strings related Operating System: FreeBSD 4.10 PHP Version: 5.0.3 New Comment:
If it worked in PHP4, it doesn't mean it will work in PHP 5 where it's behaving like it should have behaved in PHP 4 too.. And $a[0][0] is not same as when you assign it first.. Previous Comments: ------------------------------------------------------------------------ [2005-03-31 21:49:15] php at alterego dot dp dot ua Description: ------------ Strings offsets in PHP5 are broken strangely. Seems like repeated offsets are not allowed at all, even at the times where they make good sense. I see nothing fatal in $a[0][0] or even $a{0}{0} or even $a[0]{0}[0] if $a is a non-empty string. And PHP5 just crashes at any one of them. Why $a{0} can't be a string without extra intermediate assignment? Please, look at the code before marking bogus. Reproduce code: --------------- <? $a = '0'; $b = $a[0]; echo $b[0]; $a = '0'; // leave any one line of the next few echo $a[0][0]; echo $a[0]{0}; echo $a{0}{0}; echo $a[0]{0}[0]; ?> Expected result: ---------------- 00 Actual result: -------------- 0 Fatal error: Cannot use string offset as an array in /www/test.php on line 8 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32522&edit=1