|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48899 is_callable returns true even if method does not exist in parent class
Submitted: 2009-07-12 23:25 UTC Modified: 2009-07-15 01:11 UTC
From: hm at mkjc dot net Assigned: felipe (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3.0 OS: Windows Vista x64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: hm at mkjc dot net
New email:
PHP Version: OS:


 [2009-07-12 23:25 UTC] hm at mkjc dot net
is_callable returns "true" for methods that are not present in the parent class, but in the child class, even if you use the "parent" keyword.

Earlier php versions correctly returned false, since the method is missing in the parent class.

Perhaps it has something to do with the changes in conjunction with late static binding.

Reproduce code:
  class ParentClass {
  class ChildClass extends ParentClass {
    public function testIsCallable() {
	  var_dump(is_callable(array($this, 'parent::testIsCallable')));
  $child = new ChildClass();

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-15 01:11 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 25 10:03:37 2021 UTC