note 94613 added to language.oop5.magic
| From: | Stratadrake at osu1 dot php dot net | Date: | Sat, 14 Nov 2009 19:43:29 +0000 |
| Subject: | note 94613 added to language.oop5.magic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-162904@lists.php.net to get a copy of this message | ||
@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.
----
Server IP: 64.71.164.2
Probable Submitter: 67.237.238.105
----
Manual Page -- http://www.php.net/manual/en/language.oop5.magic.php
Edit -- https://master.php.net/note/edit/94613
Del: integrated -- https://master.php.net/note/delete/94613/integrated
Del: useless -- https://master.php.net/note/delete/94613/useless
Del: bad code -- https://master.php.net/note/delete/94613/bad+code
Del: spam -- https://master.php.net/note/delete/94613/spam
Del: non-english -- https://master.php.net/note/delete/94613/non-english
Del: in docs -- https://master.php.net/note/delete/94613/in+docs
Del: other reasons-- https://master.php.net/note/delete/94613
Reject -- https://master.php.net/note/reject/94613
Search -- https://master.php.net/manage/user-notes.php