ID: 48581
Updated by: [email protected]
Reported By: yeti at na-svyazi dot ru
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: winxp
PHP Version: 5.3CVS-2009-06-17 (snap)
New Comment:
$a->c(2); looks for a method c in the object, not a property. This is
currently expected behavior. We will consider adding this in later
versions.
Previous Comments:
------------------------------------------------------------------------
[2009-06-17 10:45:35] yeti at na-svyazi dot ru
Description:
------------
__invoke in child class not worked correctly?
Reproduce code:
---------------
class Callable
{
function __invoke($x) {
var_dump($x);
}
}
class A {}
$obj = new Callable;
$a = new A;
$a->c = $obj;
var_dump(is_callable($obj));
var_dump(is_callable($a->c));
$obj(1);
$a->c(2);
Expected result:
----------------
bool(true)
bool(true)
int(1)
int(2)
Actual result:
--------------
bool(true)
bool(true)
int(1)
Fatal error: Call to undefined method A::c() in E:\Work\1.php on line
22
PHP Fatal error: Call to undefined method A::c() in E:\Work\1.php on
line 22
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48581&edit=1