bug38055.phpt 876 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --TEST--
  2. Bug #38055 (Wrong interpretation of boolean parameters)
  3. --EXTENSIONS--
  4. soap
  5. --INI--
  6. soap.wsdl_cache_enabled=0
  7. --FILE--
  8. <?php
  9. function Test($param) {
  10. global $g1, $g2;
  11. $g1 = $param->boolA;
  12. $g2 = $param->boolB;
  13. return 1;
  14. }
  15. class TestSoapClient extends SoapClient {
  16. function __construct($wsdl) {
  17. parent::__construct($wsdl);
  18. $this->server = new SoapServer($wsdl);
  19. $this->server->addFunction('Test');
  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. $client = new TestSoapClient(__DIR__.'/bug38055.wsdl');
  30. $boolA = 1;
  31. $boolB = '1';
  32. $res = $client->Test(array('boolA'=>$boolA, 'boolB'=>$boolB));
  33. var_dump($g1);
  34. var_dump($g2);
  35. ?>
  36. --EXPECT--
  37. bool(true)
  38. bool(true)