From: remyfox at hotmail dot com
Operating system: windows 7
PHP version: 5.4Git-2014-07-15 (Git)
Package: Unknown/Other Function
Bug Type: Bug
Bug description:is_callable and self
Description:
------------
PHP 5.4.7
When "self" is provided to is_callable, while inside a class that
doesn't contain the method nor has a parent with the method, it will
behave as $this.
Subsequent calling of the method which had been falsely declared
callable, will result in
Fatal error: Call to undefined method A::y() in *__FILE__* on line 5
Test script:
---------------
<?php
class A {
public function x() {
if (is_callable(array($this, "y"))) $this::y();
if (is_callable(array("self", "y"))) self::y();
}
}
class B extends A {
public function y() {}
}
(new B())->x();
?>
Expected result:
----------------
Self should behalve like __CLASS__ in the example above and the fatal
error should be avoided.
--
Edit bug report at https://bugs.php.net/bug.php?id=67620&edit=1
--