bug34643.phpt 942 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --TEST--
  2. Bug #34643 (wsdl default value)
  3. --EXTENSIONS--
  4. soap
  5. --INI--
  6. soap.wsdl_cache_enabled=0
  7. --FILE--
  8. <?php
  9. ini_set("soap.wsdl_cache_enabled", 0);
  10. class fp {
  11. public function get_it($opt="zzz") {
  12. return $opt;
  13. }
  14. }
  15. class LocalSoapClient extends SoapClient {
  16. function __construct($wsdl, $options) {
  17. parent::__construct($wsdl, $options);
  18. $this->server = new SoapServer($wsdl, $options);
  19. $this->server->setClass('fp');
  20. }
  21. function __doRequest($request, $location, $action, $version, $one_way = 0): ?string {
  22. ob_start();
  23. $this->server->handle($request);
  24. $response = ob_get_contents();
  25. ob_end_clean();
  26. return $response;
  27. }
  28. }
  29. $cl = new LocalSoapClient(__DIR__.'/bug34643.wsdl', array("trace"=>1));
  30. print_r($cl->__getFunctions());
  31. echo $cl->get_it("aaa")."\n";
  32. echo $cl->get_it()."\n";
  33. var_dump($cl->get_it(null));
  34. ?>
  35. --EXPECT--
  36. Array
  37. (
  38. [0] => string get_it(string $opt)
  39. )
  40. aaa
  41. zzz
  42. NULL