|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-10-19 03:23 UTC] bbatchel at stetson dot edu
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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 19:00:01 2025 UTC |
Use "<br>{$Object1->Object2->Data}<br>" for this.