From: daniel dot gorski at develnet dot org Operating system: Linux PHP version: 5.3.0alpha2 PHP Bug Type: *Data Exchange functions Bug description: SoapClient() stumbles over its "stream_context" parameter
Description: ------------ SoapClient()'s "stream_context" parameter gets mangled if used in a function. The stream context becomes disfunctional. Below are two examples listed of which one does not work. Although not quite sure, this might be also related to #46096. Reproduce code: --------------- error_reporting(E_ALL|E_STRICT); define( 'URI', 'http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl' ); // Example 1, emits a warning, mangles value of $ctx. function getSoapClient_1() { $ctx = stream_context_create(); return new SoapClient(URI, array('stream_context' => $ctx)); } // Explicit output not required to see the error/warning. getSoapClient_1()->__soapCall('Help', array()); // --- // Example 2, works as far I can see. $ctx = stream_context_create(); function getSoapClient_2($ctx) { return new SoapClient(URI, array('stream_context' => $ctx)); } // No output, no warning, seems OK. getSoapClient_2($ctx)->__soapCall('Help', array()); Expected result: ---------------- At least no output as not output is triggered. Actual result: -------------- "Warning: SoapClient::__doRequest(): XX is not a valid Stream-Context resource in [...]" Where the XX is the resource number id. Interestingly the output is not "Resource #XX .." but just the number "XX" without the leading hash. -- Edit bug report at http://bugs.php.net/?id=46427&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46427&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46427&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46427&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46427&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46427&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=46427&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46427&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46427&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46427&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46427&r=support Expected behavior: http://bugs.php.net/fix.php?id=46427&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46427&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46427&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46427&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46427&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46427&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46427&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46427&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46427&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46427&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46427&r=mysqlcfg