note 40536 modified in function.call-user-method by vrana
| From: | vrana@php.net | Date: | Tue, 17 Aug 2004 14:53:57 +0000 |
| Subject: | note 40536 modified in function.call-user-method by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79764@lists.php.net to get a copy of this message | ||
note that if the called method returns null, call_user_method fails.
<?php
class toto{
function titi(){
...
$return = null;
...
return $return;
}
}
...
$tutu = new toto();
if(!@$return = call_user_method('titi', 'toto')){
echo "failed";
}else{
echo $return;
}
?>
outputs "failed".
--was--
note that if the called method returns null, call_user_method fails.
class toto{
function titi(){
...
$return = null;
...
return $return;
}
}
...
$tutu = new toto();
if(!@$return = call_user_method('titi', 'toto')){
echo "failed";
}else{
echo $return;
}
outputs "failed".
http://php.net/manual/en/function.call-user-method.php