|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-08-17 06:01 UTC] alan at akbkhome dot com
Description:
------------
something changed in 5.0.1 that breaks conditional class definitions. hence breaking code that worked ok on php4 & php5.0.0
Reproduce code:
---------------
<?php
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:
----------------
nothing
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 />
a
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 22:00:01 2025 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. eval(' class PHP4_Overload { function __call($method,$args,&$return) { return $this->_call($method,$args,$return);; } } ');