Re: [PHP] Execution order of PHP

[email protected] (Auke van Slooten)
Newsgroups php.general
Message-ID <[email protected]>
Jochem Maas wrote:
> Op 3/10/10 1:29 PM, Auke van Slooten schreef:
>> Hi,
>>
>> In a hobby project I'm relying on the order in which the following piece
>> of PHP code is executed:
>>
>> $client->system->multiCall(
>>   $client->methodOne(),
>>   $client->methodTwo()
>> );
>>
> 
> but who cares. the code is full of magic, which makes it difficult to understand
> and maintain ... fix it so that it's explicit about what it's doing so that
> other developers who read it will grasp the concept without having to dig
> into your magic methods. this solves the problem of undiscernable magic and
> possible issues with resolution order in the future as well (which if they
> happened would be a royal PITA to debug, given the magic methods involved)

I've decided to rewrite the API so it is more upfront about what it 
does. Your argument about readability, when the API is unknown, is a 
valid one. It now works like this:

$client->system->multiCall(
   ripcord::encodeCall('methodOne'),
   ripcord::encodeCall('methodTwo')
);

Thanks for all your input,
Auke van Slooten
Muze
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.