note 32384 added to function.call-user-func
| From: | gabriel at bumpt dot net | Date: | Mon, 26 May 2003 12:41:07 +0000 |
| Subject: | note 32384 added to function.call-user-func | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-49028@lists.php.net to get a copy of this message | ||
In addition to the note by dougqh at hotmail dot com :
If you need to call a method of a class, and you don't have an instance of this class -- in
other words, the method is 'static' in the C++ meaning -- you can use the scope operator
:: on your class:
class MyClass
{
function MyStaticFunc()
{ ... }
}
//This calls the function on no particular instance.
//Warning: do not use $this in such a function,
//nor call any non-class-level function
//from within your class-level function.
MyClass::MyStaticFunc();
----
Manual Page -- http://www.php.net/manual/en/function.call-user-func.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32384
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32384&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32384&report=yes