#23353 [Csd]: inline variable detection only handles one dereference
| From: | spagmoid at yahoo dot com | Date: | Sat, 26 Apr 2003 21:40:52 +0000 |
| Subject: | #23353 [Csd]: inline variable detection only handles one dereference | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-38482@lists.php.net to get a copy of this message | ||
ID: 23353
User updated by: spagmoid at yahoo dot com
Reported By: spagmoid at yahoo dot com
Status: Closed
Bug Type: *General Issues
Operating System: WinXP
PHP Version: 4.3.1
New Comment:
Hopefully someone will at least fix the docs then.
Previous Comments:
------------------------------------------------------------------------
[2003-04-26 16:39:25] wez@php.net
PHP 4 does not (and will not) support this kind of dereferencing.
It *is* a feature of PHP 5; you are welcome to try a snapshot from
http://snaps.php.net, but it is still beta.
------------------------------------------------------------------------
[2003-04-26 16:03:29] spagmoid at yahoo dot com
If the parser accepts $A->B why can't it accept $A->B->C ?? come on.
------------------------------------------------------------------------
[2003-04-26 16:02:35] spagmoid at yahoo dot com
Very well, break the documentation instead of fixing the code:
Chapter 7. Types
/strings
Simple syntax
If a dollar sign ($) is encountered, the parser will greedily take as
much tokens as possible to form a valid variable name.
------------------------------------------------------------------------
[2003-04-26 15:55:56] pollita@php.net
Where are you getting the information that:
php is supposed to use "as much text as possible" when detecting
variables in strings, but it stops at the first object.
Is this in the manual somewhere? If so that page should be updated.
For complex variable references in interpolated string you must
encapsulate them in curly braces. In your example try:
$String = "text {$Obj->Obj->Prop} text";
------------------------------------------------------------------------
[2003-04-26 15:32:30] spagmoid at yahoo dot com
Yes, this is a bug. Try again.
------------------------------------------------------------------------
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
http://bugs.php.net/23353
--
Edit this bug report at http://bugs.php.net/?id=23353&edit=1