note 94613 deleted from language.oop5.magic by danbrown
| From: | danbrown@php.net | Date: | Sun, 15 Nov 2009 03:58:26 +0000 |
| Subject: | note 94613 deleted from language.oop5.magic by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-162918@lists.php.net to get a copy of this message | ||
Note Submitter: Stratadrake
----
@vad dot viktor at gmail dot com --
That's because __invoke() only works in an object context and cannot be used statically; the
only time you generally need to "invoke" the class itself is when you want to create a new
object of that class, and that's what the "new" keyword does already -- it tells PHP
that the following word is a class name instead of a function call.
Additionally there is no mechanism to "autodeclare" functions, calling an undefined
function always triggers an E_ERROR.