Re: __call interceptor and static methods
| From: | Stanislav Malyshev | Date: | Mon, 08 Nov 2004 10:57:37 +0000 |
| Subject: | Re: __call interceptor and static methods | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-13785@lists.php.net to get a copy of this message | ||
MB>>Adding an argument would be a major BC but sure is_null($this) would work,
MB>>only it would be another big slowdown.
I don't think 2-3 additional opcodes are a "big" slowdown - if you are
using non-default ctors and accessors anyway, you probably are doing
something order of magnitude bigger there, not to mention PHP function
call is costly by itself.
As for BC - I think it can be made so it would accept old code too, and
some set of rules could be made about when to call what - e.g., basing on
number of arguments. If, of course, the whole thing is needed anyway :)
MB>>__static_construct would be called the first time the class is going to be
MB>>used.
The idea doen't seem appealing to me... I wonder why one would need such
tricks and why one won't use more civilized way of doing things - like
appropriate patterns which don't have to require such magic.
--
Stanislav Malyshev, Zend Products Engineer
stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115