note 109073 modified in language.types.callable by danbrown
| From: | danbrown@php.net | Date: | Tue, 19 Jun 2012 13:45:37 +0000 |
| Subject: | note 109073 modified in language.types.callable by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-188694@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;
} } ?>
--was--
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;
}
}
http://php.net/manual/en/language.types.callable.php