From: ebypdx at comcast dot net
Operating system: Solaris 5.8
PHP version: 4.3.10
PHP Bug Type: Class/Object related
Bug description: overloading using __call() initially OK, fails on any
subsequent method call
Description:
------------
in the most simple case, create a class with no methods except __call()
and overload it. start calling methods on an instance of that class. the
first method call will hit __call() and finish correctly. any subsequent
method calls will fail to hit __call(), resulting instead in a fatal
error.
if this is indeed a bug... i realize due to the experimental nature of
overloading in 4.3, that this may never work again. my deepest thanks to
anybody who can address this.
Reproduce code:
---------------
<?php
class BaseOverloader {
function BaseOverloader() {}
function __call($method, $args, &$returnValue) {
echo "Call to ".get_class($this)."->$method <br/>";
$returnValue = "return";
return true;
}
}
overload("BaseOverloader");
$c = new BaseOverloader();
$c->firstCall();
$c->secondCall();
?>
Expected result:
----------------
Call to BaseOverloader->firstcall
Call to BaseOverloader->secondcall
Actual result:
--------------
Call to baseoverloader->firstcall
Fatal error: Call to a member function on a non-object in
/export/vol01/opt/web/neby/partner.newedgenetworks.com/overloaded.php on
line 13
--
Edit bug report at http://bugs.php.net/?id=31214&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31214&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=31214&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=31214&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31214&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31214&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31214&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31214&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31214&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31214&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31214&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=31214&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=31214&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31214&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31214&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31214&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31214&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31214&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31214&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31214&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31214&r=mysqlcfg