note 27120 modified in function.call-user-func by vrana
| From: | vrana@php.net | Date: | Tue, 17 Aug 2004 14:53:30 +0000 |
| Subject: | note 27120 modified in function.call-user-func by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79755@lists.php.net to get a copy of this message | ||
On PHP 4.2.3 (not sure about older releases) you can send objects by reference by sending the
reference from call_user_func()
<?php
function myFunction(@$obj)
{
$obj->doThis('hello');
return 0;
}
$myObj = new CObject();
call_user_func('myFunction', @$myObj);
?>
--was--
On PHP 4.2.3 (not sure about older releases) you can send objects by reference by sending the
reference from call_user_func()
function myFunction(@$obj)
{
$obj->doThis('hello');
return 0;
}
$myObj = new CObject();
call_user_func('myFunction', @$myObj);
http://php.net/manual/en/function.call-user-func.php