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
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php