PageRenderTime 29ms CodeModel.GetById 10ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/test/slow/ext_soap/classmap_extension_crash.php

http://github.com/facebook/hiphop-php
PHP | 44 lines | 36 code | 8 blank | 0 comment | 0 complexity | fb7ba57a2fbf04f2cbd580e85e66057d MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?hh
  2. class A {
  3. public $x;
  4. }
  5. class B extends A {
  6. public $y;
  7. }
  8. function f($a) {
  9. return $a;
  10. }
  11. class LocalSoapClient extends SoapClient {
  12. function __construct($wsdl, $options) {
  13. parent::__construct($wsdl, $options);
  14. $this->server = new SoapServer($wsdl, $options);
  15. $this->server->addFunction("f");
  16. }
  17. function __doRequest($request, $location, $action, $version, $one_way = 0) {
  18. ob_start();
  19. $this->server->handle($request);
  20. $response = ob_get_contents();
  21. ob_end_clean();
  22. return $response;
  23. }
  24. }
  25. <<__EntryPoint>>
  26. function main_classmap_extension_crash() {
  27. ini_set("soap.wsdl_cache_enabled", 0);
  28. $client = new LocalSoapClient(
  29. dirname(__FILE__) . "/classmap_extension_crash.wsdl",
  30. darray['classmap' => darray['A' => 'A', 'B' => 'B']]
  31. );
  32. $b = new B();
  33. $b->x = 1;
  34. $b->y = 2;
  35. print_r($client->__soapcall('f', varray[$b]));
  36. }