Re: Re: __call overload detection

From: Date: Thu, 05 Jan 2006 06:20:11 +0000
Subject: Re: Re: __call overload detection
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-21427@lists.php.net to get a copy of this message
This'll do what you want: http://libssh2.org/dist/callable-1.0.tgz
Thanks Sara. Nice to see that others have the need. Works like a charm. You rock. Just for clarification. I didn't have a need for this, it's just something I threw together today since it was simple...
Marcus, is this along the lines of what you had in mind for the (possible) implementation? This doesn't use interfaces, but that seems trivial. I wasn't clear if you'd envisioned taking it one step further and do the check before invocations of __call or not. I left interfaces out 'cause I wanted it to work easily with PHP4. As to introducing the check prior to invoking __call()... that seems like overkill. If __call() doesn't think it should be callable it should trigger_error() or throw when its invoked that way. __callable() only has meaning for avoiding the errors that calling an uncallable function would produce.
-Sara

« previous php.internals (#21427) next »