note 76237 added to function.call-user-func

From: Date: Fri, 06 Jul 2007 17:09:59 +0000
Subject: note 76237 added to function.call-user-func
Groups: php.notes 
Request: Send a blank email to php-notes+get-128270@lists.php.net to get a copy of this message
2lsblsb: I'm agree what call_user_func_array is a better way for passing args by reference But now for this I prefer variable-functions. E.g. set a callback in class: if ($this->event) {$func = $this->event; $func($obj);} This allows you to choose to recive arguments by reference or not in function declaration $some_class->event = "my_event"; function my_event(&$obj) { //... } ---- Server IP: 195.54.192.44 Probable Submitter: 83.149.3.165 ---- Manual Page -- http://www.php.net/manual/en/function.call-user-func.php Edit -- https://master.php.net/note/edit/76237 Del: integrated -- https://master.php.net/note/delete/76237/integrated Del: useless -- https://master.php.net/note/delete/76237/useless Del: bad code -- https://master.php.net/note/delete/76237/bad+code Del: spam -- https://master.php.net/note/delete/76237/spam Del: non-english -- https://master.php.net/note/delete/76237/non-english Del: in docs -- https://master.php.net/note/delete/76237/in+docs Del: other reasons-- https://master.php.net/note/delete/76237 Reject -- https://master.php.net/note/reject/76237 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#128270) next »