From: yeti at na-svyazi dot ru
Operating system: winxp
PHP version: 5.3CVS-2009-06-17 (snap)
PHP Bug Type: Scripting Engine problem
Bug description: __invoke in child class
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 bug report at http://bugs.php.net/?id=48581&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48581&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48581&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48581&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48581&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48581&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48581&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48581&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48581&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48581&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48581&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48581&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48581&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48581&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48581&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48581&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48581&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48581&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48581&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48581&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48581&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48581&r=mysqlcfg