Bug #61507 [Ver]: Incompatibilty when using isset() on a string with a string key as offset
| From: | yohgaki@php.net | Date: | Sat, 31 Mar 2012 02:55:59 +0000 |
| Subject: | Bug #61507 [Ver]: Incompatibilty when using isset() on a string with a string key as offset | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-169046@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61507&edit=1
ID: 61507
Updated by: yohgaki@php.net
Reported by: joffery at ne2000 dot nl
Summary: Incompatibilty when using isset() on a string with a
string key as offset
Status: Verified
Type: Bug
Package: Scripting Engine problem
Operating System: ANY
PHP Version: 5.4.0
Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
Someone who remember the conclusion of var_dump(isset($str["x"]["x"]) could
write
comment?
I'm not sure how $str['x'] is treated now.
If it's doc problem, I'll fix the doc.
Previous Comments:
------------------------------------------------------------------------
[2012-03-31 02:08:46] yohgaki@php.net
Changed bug type from "Doc" to "Bug".
Changed Package from "string related" to "scripting engine problem".
I think this should be fixed before 5.4.1.
------------------------------------------------------------------------
[2012-03-26 16:37:53] yohgaki@php.net
It does. This should be addressed.
------------------------------------------------------------------------
[2012-03-26 10:18:34] joffery at ne2000 dot nl
Description:
------------
Incompatibility when using isset() on a string with a string key as offset.
Probably an effect of the change "Simplified string offset reading. $str[1][0] is now a legal
construct.".
Current implementation seems correct although this is an incompatibility in previous versions and
should be documented.
A previous bug (#37727) noted that behavior before 5.4 was incorrect but was filed as 'not a
bug'.
Test script:
---------------
$ php -r '$str = "str"; var_dump(isset($str["x"]));'
Expected result:
----------------
bool(false)
Actual result:
--------------
PHP 5.3.9:
bool(true)
PHP 5.4.0:
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61507&edit=1