Andrew Ballard wrote:
I'm not sure you would want to assign null to $client->system. After
all, __set() might not be defined.
I agree with Rob here. If order is really crucial, then call the
statements in the correct order:
* causes $client to call __get() in order to resolve
$system = $client->system;
* You should add some handling here to make sure that
* $system is really an object that implements your
* multiCall() method, and not something else (like null).
I agree with both of you. If you want it ironclad and you cannot change
the API, then this is how I would do it. The point is that I _can_
change the API, but I like how simple it looks. The backup plan is to do
The only problem with this is that I'm polluting the $client 'namespace'
with a __defer method. And it looks less clean... :)
Now if the consensus is that you absolutely cannot rely on the execution
order in this case (not for the order in which function parameters are
evaluated, I don't care about that) then I will just change my API and
remember with fondness what I could not have...
Auke van Slooten
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php