note 86400 added to function.call-user-func-array
| From: | rpeters at icomproductions dot ca | Date: | Thu, 16 Oct 2008 15:44:11 +0000 |
| Subject: | note 86400 added to function.call-user-func-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-145431@lists.php.net to get a copy of this message | ||
I'm trying to find a method of calling the parent constructor while passing an array of
parameters that works in all versions of PHP 5.0+.
I've got two dev setups right now, 5.1.1 and 5.2.6.
return call_user_func_array(array($this, 'parent::__construct'), $arrParentArgs);
causes a warning in 5.1.1
$parent_class=get_parent_class($this);
call_user_func_array(array($parent_class, '__construct'), $arrParentArgs);
causes an e_strict message in 5.2.6
What's the correct way of doing this?
Both constructors use func_get_args() to allow infinite parameters, so the traditional
parent::__construct($arg1,$arg2,etc) method fails.
----
Server IP: 66.207.199.35
Probable Submitter: 68.145.111.83
----
Manual Page -- http://www.php.net/manual/en/function.call-user-func-array.php
Edit -- https://master.php.net/note/edit/86400
Del: integrated -- https://master.php.net/note/delete/86400/integrated
Del: useless -- https://master.php.net/note/delete/86400/useless
Del: bad code -- https://master.php.net/note/delete/86400/bad+code
Del: spam -- https://master.php.net/note/delete/86400/spam
Del: non-english -- https://master.php.net/note/delete/86400/non-english
Del: in docs -- https://master.php.net/note/delete/86400/in+docs
Del: other reasons-- https://master.php.net/note/delete/86400
Reject -- https://master.php.net/note/reject/86400
Search -- https://master.php.net/manage/user-notes.php