|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-12-07 13:22 UTC] sniper@php.net
[2003-12-07 13:54 UTC] tater at potatoe dot com
[2004-01-05 07:06 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ Using call_user_func() for the equivalent of self::method() or parent::method() results in a warning. This has worked for quite some time, and as recently as beta2. From Zend/ChangeLog: <pre> 2003-06-09 Stanislav Malyshev <stas@zend.com> * zend_API.c zend_execute_API.c: Support 'self' and 'parent' in call_user_func() </pre> Reproduce code: --------------- class fooparent { function t() { print "fooparent::t()\n"; } } class foo extends fooparent { function p() { $this->t(); parent::t(); call_user_func(array('parent','t')); } } $a = new foo; $a->p(); Expected result: ---------------- fooparent::t() fooparent::t() fooparent::t() Actual result: -------------- fooparent::t() fooparent::t() Warning: call_user_func(parent::t): First argument is expected to be a valid callback in /my/path/bug.php on line 12