Doc #61507 [Asn->Csd]: Incompatibilty when using isset() on a string with a string key as offset
| From: | yohgaki@php.net | Date: | Sat, 31 Mar 2012 09:48:52 +0000 |
| Subject: | Doc #61507 [Asn->Csd]: Incompatibilty when using isset() on a string with a string key as offset | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-8146@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: Assigned
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: ANY
PHP Version: 5.4.0
Assigned To: yohgaki
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2012-03-31 07:22:42] stas@php.net
String offset must be a number.
------------------------------------------------------------------------
[2012-03-31 02:55:59] yohgaki@php.net
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.
------------------------------------------------------------------------
[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