note 27120 deleted from function.call-user-func by cmb
| From: | cmb@php.net | Date: | Sun, 08 Dec 2019 11:17:17 +0000 |
| Subject: | note 27120 deleted from function.call-user-func by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213454@lists.php.net to get a copy of this message | ||
Note Submitter: matt at tasonline dot com
----
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);
?>