|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29716 __call with wrong no. of arguments prevents simple BC wrappers.
Submitted: 2004-08-17 06:01 UTC Modified: 2004-08-20 05:51 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: alan at akbkhome dot com Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 5.* OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: alan at akbkhome dot com
New email:
PHP Version: OS:


 [2004-08-17 06:01 UTC] alan at akbkhome dot com
something changed in 5.0.1 that breaks conditional class definitions. hence breaking code that worked ok on php4 & php5.0.0

Reproduce code:
if (true) { // this is the correct definition. (used for php5)

    class Overloaded {
        function __call($method,$args) {
} else { // this is used for php4
    class Overloaded {
        function __call($method,$args,&$return) {


Expected result:

Actual result:
Content-type: text/html
X-Powered-By: PHP/5.0.1
<br />
<b>Fatal error</b>:  Method DB_DataObject_Overload::__call() must take exactly 2 arguments in <b>/usr/src/php/php-5.0.1/test1.php</b> on line <b>16</b><br />


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-17 06:21 UTC]
Relivant change

I suggest testing for > 1, rather than != 2 on call, as that's the only one who's API changed in PHP4->5

 [2004-08-17 08:15 UTC]
Marcus breaks it, marcus should fix it :)
Also, can you please add a test case for this?

 [2004-08-17 09:18 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

We no longer support ext/overload (and ext/aggregation). In PHP 5 __autoload was reimplemented as a new different feature even though it is in some manner meant to be able to replace the old behavior. But it is meant to do it etter and offer more. Hence unfortunatley those two are different things and yes we broke BC.
 [2004-08-17 09:25 UTC]
Btw. ext/overload:
This extension is EXPERIMENTAL. The behaviour of this extension -- including the names of its functions and anything else documented about this extension -- may change without notice in a future release of PHP. Use this extension at your own risk
 [2004-08-20 05:50 UTC]
changing status to reflect situation.  

Probably the best workaround to offer overload PHP4/PHP5 compatiblity is to use eval to create a base class eg.

        class PHP4_Overload {
            function __call($method,$args,&$return) {
                return $this->_call($method,$args,$return);;

 [2004-08-20 05:51 UTC]
changing title (oops)
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue May 11 08:01:24 2021 UTC