#23353 [Opn->Csd]: inline variable detection only handles one dereference

From: Date: Sat, 26 Apr 2003 21:39:25 +0000
Subject: #23353 [Opn->Csd]: inline variable detection only handles one dereference
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38481@lists.php.net to get a copy of this message
ID: 23353 Updated by: wez@php.net Reported By: spagmoid at yahoo dot com -Status: Open +Status: Closed Bug Type: *General Issues Operating System: WinXP PHP Version: 4.3.1 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ [2003-04-25 17:22:16] sniper@php.net Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. . ------------------------------------------------------------------------ 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

« previous php.bugs (#38481) next »