|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-04-25 17:21 UTC] spagmoid at yahoo dot com
php is supposed to use "as much text as possible" when detecting variables in strings, but it stops at the first object. $Obj->Prop = "purple"; $String = "text $Obj->Prop text"; result: text purple text $Obj->Obj->Prop = "purple"; $String = "text $Obj->Obj->Prop text"; result: text object->Prop text PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 10:00:01 2025 UTC |
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";