|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-07-15 01:11 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 15:00:01 2025 UTC |
Description: ------------ 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: --------------- <?php class ParentClass { } class ChildClass extends ParentClass { public function testIsCallable() { var_dump(is_callable(array($this, 'parent::testIsCallable'))); } } $child = new ChildClass(); $child->testIsCallable(); ?> Expected result: ---------------- bool(false) Actual result: -------------- bool(true)