Re: A quick consensus on magic method idea
| From: | Benjamin Eberlei | Date: | Fri, 04 Feb 2011 08:13:09 +0000 |
| Subject: | Re: A quick consensus on magic method idea | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-51430@lists.php.net to get a copy of this message | ||
Couldn't you just write an autoloader that triggers this method if
available on any class autoloaded? This obviously only works if you are
using the one class in one file approach, but would be just as powerful
then.
On Thu, 3 Feb 2011 21:06:00 -0800, Chris Stockton
<chrisstocktonaz@gmail.com> wrote:
> Hello,
>
> On Thu, Feb 3, 2011 at 8:53 PM, Rasmus Lerdorf <rasmus@lerdorf.com>
wrote:
>>
>> This creates problems for opcode caches since the classes are all
>> precompiled and usually optimized to the point where the opcodes that
>> loads them are NOP'ed away and you just have the full class table
cached
>> in memory for each op_array. Walking through that class table on every
>> request and looking for these magic methods to call would be quite
>> annoying, especially since most of them wouldn't have such a method to
>> begin with.
>>
>
> That is a good point and something I didn't think about. The pain that
> would create immediately negates the small luxury it would add.
>
> Thanks,
>
> -Chris