Doc #61507 [Com]: Incompatibilty when using isset() on a string with a string key as offset

From: Date: Sat, 11 Aug 2012 01:03:31 +0000
Subject: Doc #61507 [Com]: 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-8730@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 Comment by: mkwan at corp dot oodle dot com Reported by: joffery at ne2000 dot nl Summary: Incompatibilty when using isset() on a string with a string key as offset 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: Is the implication that using a string key offset is undefined behavior, so it doesn't matter what PHP does? Because, if the _defined_ behavior is to return false, then it is inconsistent with other contexts. $ php -r '$str = "str"; var_dump(isset($str["x"]));' bool(false) $ php -r '$str = "str"; var_dump($str["x"]);' string(1) "s" How can something not be set but also have a value? Previous Comments: ------------------------------------------------------------------------ [2012-03-31 09:48:52] yohgaki@php.net 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. ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=61507 -- Edit this bug report at https://bugs.php.net/bug.php?id=61507&edit=1

« previous php.doc.bugs (#8730) next »