note 109073 added to language.types.callable
| From: | andrewbessa at gmail dot com | Date: | Tue, 19 Jun 2012 03:16:31 +0000 |
| Subject: | note 109073 added to language.types.callable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188682@lists.php.net to get a copy of this message | ||
You can also use the $this variable to specify a callback:
<?php
class MyClass {
public $property = 'Hello World!';
public function MyMethod()
{
call_user_func(array($this, 'myCallbackMethod'));
}
public function MyCallbackMethod()
{
echo $this->property;
}
}
----
Server IP: 69.147.83.197
Probable Submitter: 72.133.207.252
----
Manual Page -- http://www.php.net/manual/en/language.types.callable.php
Edit -- https://master.php.net/note/edit/109073
Del: integrated -- https://master.php.net/note/delete/109073/integrated
Del: useless -- https://master.php.net/note/delete/109073/useless
Del: bad code -- https://master.php.net/note/delete/109073/bad+code
Del: spam -- https://master.php.net/note/delete/109073/spam
Del: non-english -- https://master.php.net/note/delete/109073/non-english
Del: in docs -- https://master.php.net/note/delete/109073/in+docs
Del: other reasons-- https://master.php.net/note/delete/109073
Reject -- https://master.php.net/note/reject/109073
Search -- https://master.php.net/manage/user-notes.php