From: Operating system: Linux 2.6.18-194 (Centos 5.5) PHP version: 5.3.5 Package: SOAP related Bug Type: Bug Bug description:SoapClient classmap ignores currently set namespace
Description: ------------ When a class extending SoapClient is defined in a namespace, the classmap ignores the current namespace and maps classes directly to the global namespace. In order for it to function correctly, the classmap must include the "fully qualified" namespace\classname as the target. Currently, I'm using a wrapper class for SoapClient that prepends __NAMESPACE__ onto the classmap entries to get around this issue. Test script: --------------- // This is NOT a fully complete test script, since it requires testing against an actual SOAP server to function. Plus I couldn't fit that in 20 lines. //Does not work: namespace Other; class OtherService extends \SoapClient { private static $classmap = array( 'session' => 'session', 'foo' => 'foo' ); // etc etc } //Works: namespace Other; class OtherService extends \SoapClient { private static $classmap = array( 'session' => 'Other\session', 'foo' => 'Other\foo' ); // etc etc } Expected result: ---------------- The classmap would obey the current namespace. Actual result: -------------- PHP Fatal error: Class 'session' not found in test.php on line XX -- Edit bug report at http://bugs.php.net/bug.php?id=54074&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54074&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54074&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54074&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=54074&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54074&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=54074&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=54074&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=54074&r=needscript Try newer version: http://bugs.php.net/fix.php?id=54074&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=54074&r=support Expected behavior: http://bugs.php.net/fix.php?id=54074&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=54074&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=54074&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=54074&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54074&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=54074&r=dst IIS Stability: http://bugs.php.net/fix.php?id=54074&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=54074&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=54074&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=54074&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=54074&r=mysqlcfg