Re: [PEPr] Comment on XML::XML_RPC_Simple

From: Date: Sat, 10 Apr 2004 17:21:28 +0000
Subject: Re: [PEPr] Comment on XML::XML_RPC_Simple
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-27398@lists.php.net to get a copy of this message
Le jeu 08/04/2004 à 04:51, PEPr a écrit : > Greg Beaver (http://pear.php.net/user/cellog) has commented on the proposal for > XML::XML_RPC_Simple. > Lastly, this should support PHP 5 in __call(), since that is trivial. I try to adapt my code for PHP5 compatibility, but i don't know how fix it :'( The problem is on the "return" of the __call() Script example : <?php error_reporting(E_ALL); class Test { function __call($method, $args, &$return) { if ($method != __CLASS__) { $return = "[$method]".var_export($args, 'TRUE'); } if (phpversion() < 5) return true; } } // Call the overload() function when appropriate if (function_exists("overload") && phpversion() < 5) { overload("Test"); } $t = new Test; print $t->hello('PEAR', 'World'); ?> If you try this script on PHP 4.3.x, it's works great. But under PHP 5, the "return" make a Warning and don't return the value : Warning: Missing argument 3 for Test::__call() in (...)/test.php on line 7 Anybody have a solution for make a return of __call() under PHP 5 please ? Thanks

« previous php.pear.dev (#27398) next »