PHP 4.0 Bug #7330: variable resolution in double quoted strings doesn't like a hierarchy of object
| From: | bbatchel at stetson dot edu | Date: | Thu, 19 Oct 2000 07:23:32 +0000 |
| Subject: | PHP 4.0 Bug #7330: variable resolution in double quoted strings doesn't like a hierarchy of object | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-35490@lists.php.net to get a copy of this message | ||
From: bbatchel@stetson.edu
Operating system: Linux
PHP version: 4.0.2
PHP Bug Type: Unknown/Other Function
Bug description: variable resolution in double quoted strings doesn't like a hierarchy of
object
I am writing a database wrapper for a project I am working on. The gist of this system is based on
a hirearchy of objects - such as:
Object1:
Object2:
Data (say a string containing 'monkey')
Object3:
Data
Object4:
Data
When I do this:
echo($Ibject1->Object2->Data);
I get: monkey
When I do this:
echo("<br>$Object1->Object2->Data<br>");
I would expect to get:
<br>monkey<br>
But instead I get:
<br>Object->Data<br>
I assume that the parser is resolving $Object1->Object2 as the word object, and then
concatinating that to '->Data' as a string - instead of going down the line to the rest
of the variable.
Not a big deal, per se, but still a bug in my opinion.
For the mean time, I just assign the complex variable to a temporary variable and use that in the
string substitution.
Thanks,
--Bryan
--
Edit Bug report at: http://bugs.php.net/?id=7330&edit=1