bug69085.phpt 786 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #69085 (SoapClient's __call() type confusion through unserialize())
  3. --EXTENSIONS--
  4. soap
  5. --INI--
  6. soap.wsdl_cache_enabled=0
  7. --FILE--
  8. <?php
  9. class MySoapClient extends SoapClient {
  10. public function __doRequest($request, $location, $action, $version, $one_way = 0): string {
  11. echo $request, "\n";
  12. return '';
  13. }
  14. }
  15. $dummy = unserialize('O:12:"MySoapClient":5:{s:3:"uri";s:1:"a";s:8:"location";s:22:"http://localhost/a.xml";s:17:"__default_headers";i:1337;s:15:"__last_response";s:1:"a";s:5:"trace";s:1:"x";}');
  16. $dummy->whatever();
  17. ?>
  18. --EXPECTF--
  19. Fatal error: Uncaught TypeError: Cannot assign int to property SoapClient::$__default_headers of type ?array in %s:%d
  20. Stack trace:
  21. #0 %s(%d): unserialize('O:12:"MySoapCli...')
  22. #1 {main}
  23. thrown in %s on line %d