php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26543 call_user_func broken for self, parent
Submitted: 2003-12-06 11:08 UTC Modified: 2004-01-05 07:06 UTC
From: tater at potatoe dot com Assigned: stas (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2003-12-06 (dev) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
35 - 33 = ?
Subscribe to this entry?

 
 [2003-12-06 11:08 UTC] tater at potatoe dot com
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-07 13:22 UTC] sniper@php.net
Stanislav, can you check this out please?

 [2003-12-07 13:54 UTC] tater at potatoe dot com
btw, i reverted to before zend_make_callable() was added
(10/25), and this went away.
 [2004-01-05 07:06 UTC] stas@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 20:01:29 2024 UTC