3v4l.org

run code in 300+ PHP versions simultaneously
<?php $wsdl = <<<'WSDL' <?xml version='1.0' encoding='UTF-8'?> <definitions name="ab" targetNamespace="urn:ab" xmlns:typens="urn:ab" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types> <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ab"> <xsd:complexType name="A"> <xsd:sequence> <xsd:element name="x" type="xsd:anyType"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="Broken"> <xsd:sequence> <xsd:element name="completelyBroken" type="xsd:anyType"/> </xsd:sequence> </xsd:complexType> </xsd:schema> </types> <message name="f"> <part name="fRequest" type="typens:A"/> </message> <message name="fResponse"> <part name="fRequest" type="typens:A"/> </message> <portType name="abServerPortType"> <operation name="f"> <input message="typens:f"/> <output message="typens:fResponse"/> </operation> </portType> <binding name="abServerBinding" type="typens:abServerPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="f"> <soap:operation soapAction="urn:abServerAction"/> <input> <soap:body namespace="urn:ab" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body namespace="urn:ab" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <service name="abService"> <port name="abServerPort" binding="typens:abServerBinding"> <soap:address location="http://localhost/dummy"/> </port> </service> </definitions> WSDL; file_put_contents('test.wsdl', $wsdl); function f($a) { return $a; } class LocalSoapClient extends SoapClient { function __construct($wsdl, $options) { parent::__construct($wsdl, $options); $this->server = new SoapServer($wsdl, $options); $this->server->addFunction("f"); } function __doRequest($request, $location, $action, $version, $one_way = 0) { ob_start(); $this->server->handle($request); $response = ob_get_contents(); ob_end_clean(); return $response; } } class Broken { public $completelyBroken; } $client = new LocalSoapClient('test.wsdl', array('classmap' => array('Broken' => 'Broken')) ); $broken = new Broken(); $broken->completelyBroken = 'indeed it is'; print_r($client->f($broken));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mqC71
function name:  (null)
number of ops:  23
compiled vars:  !0 = $wsdl, !1 = $client, !2 = $broken
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%271.0%27+encoding%3D%27UTF-8%27%3F%3E%0A%3Cdefinitions+name%3D%22ab%22+targetNamespace%3D%22urn%3Aab%22+xmlns%3Atypens%3D%22urn%3Aab%22+xmlns%3Axsd%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%22+xmlns%3Asoap%3D%22http%3A%2F%2Fschemas.xmlsoap.org%2Fwsdl%2Fsoap%2F%22%0Axmlns%3Asoapenc%3D%22http%3A%2F%2Fschemas.xmlsoap.org%2Fsoap%2Fencoding%2F%22+xmlns%3Awsdl%3D%22http%3A%2F%2Fschemas.xmlsoap.org%2Fwsdl%2F%22+xmlns%3D%22http%3A%2F%2Fschemas.xmlsoap.org%2Fwsdl%2F%22%3E%0A++++++++%3Ctypes%3E%0A++++++++++++++++%3Cxsd%3Aschema+xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%22+targetNamespace%3D%22urn%3Aab%22%3E%0A++++++++++++++++++++++++%3Cxsd%3AcomplexType+name%3D%22A%22%3E%0A++++++++++++++++++++++++++++++++%3Cxsd%3Asequence%3E%0A++++++++++++++++++++++++++++++++++++++++%3Cxsd%3Aelement+name%3D%22x%22+type%3D%22xsd%3AanyType%22%2F%3E%0A++++++++++++++++++++++++++++++++%3C%2Fxsd%3Asequence%3E%0A++++++++++++++++++++++++%3C%2Fxsd%3AcomplexType%3E%0A%0A++++++++++++++++++++++++%3Cxsd%3AcomplexType+name%3D%22Broken%22%3E%0A++++++++++++++++++++++++%09%3Cxsd%3Asequence%3E%0A%09%09%09%09%09%09%09%09%3Cxsd%3Aelement+name%3D%22completelyBroken%22+type%3D%22xsd%3AanyType%22%2F%3E%0A++++++++++++++++++++++++%09%3C%2Fxsd%3Asequence%3E%0A++++++++++++++++++++++++%3C%2Fxsd%3AcomplexType%3E%0A++++++++++++++++%3C%2Fxsd%3Aschema%3E%0A++++++++%3C%2Ftypes%3E%0A%0A++++++++%3Cmessage+name%3D%22f%22%3E%0A++++++++++++++++%3Cpart+name%3D%22fRequest%22+type%3D%22typens%3AA%22%2F%3E%0A++++++++%3C%2Fmessage%3E%0A++++++++%3Cmessage+name%3D%22fResponse%22%3E%0A++++++++++++++++%3Cpart+name%3D%22fRequest%22+type%3D%22typens%3AA%22%2F%3E%0A++++++++%3C%2Fmessage%3E%0A%0A++++++++%3CportType+name%3D%22abServerPortType%22%3E%0A++++++++++++++++%3Coperation+name%3D%22f%22%3E%0A++++++++++++++++++++++++%3Cinput+message%3D%22typens%3Af%22%2F%3E%0A++++++++++++++++++++++++%3Coutput+message%3D%22typens%3AfResponse%22%2F%3E%0A++++++++++++++++%3C%2Foperation%3E%0A++++++++%3C%2FportType%3E%0A%0A++++++++%3Cbinding+name%3D%22abServerBinding%22+type%3D%22typens%3AabServerPortType%22%3E%0A++++++++++++++++%3Csoap%3Abinding+style%3D%22rpc%22+transport%3D%22http%3A%2F%2Fschemas.xmlsoap.org%2Fsoap%2Fhttp%22%2F%3E%0A++++++++++++++++%3Coperation+name%3D%22f%22%3E%0A++++++++++++++++++++++++%3Csoap%3Aoperation+soapAction%3D%22urn%3AabServerAction%22%2F%3E%0A++++++++++++++++++++++++%3Cinput%3E%0A++++++++++++++++++++++++++++++++%3Csoap%3Abody+namespace%3D%22urn%3Aab%22+use%3D%22encoded%22+encodingStyle%3D%22http%3A%2F%2Fschemas.xmlsoap.org%2Fsoap%2Fencoding%2F%22%2F%3E%0A++++++++++++++++++++++++%3C%2Finput%3E%0A++++++++++++++++++++++++%3Coutput%3E%0A++++++++++++++++++++++++++++++++%3Csoap%3Abody+namespace%3D%22urn%3Aab%22+use%3D%22encoded%22+encodingStyle%3D%22http%3A%2F%2Fschemas.xmlsoap.org%2Fsoap%2Fencoding%2F%22%2F%3E%0A++++++++++++++++++++++++%3C%2Foutput%3E%0A++++++++++++++++%3C%2Foperation%3E%0A++++++++%3C%2Fbinding%3E%0A%0A++++++++%3Cservice+name%3D%22abService%22%3E%0A++++++++++++++++%3Cport+name%3D%22abServerPort%22+binding%3D%22typens%3AabServerBinding%22%3E%0A++++++++++++++++++++++++%3Csoap%3Aaddress+location%3D%22http%3A%2F%2Flocalhost%2Fdummy%22%2F%3E%0A++++++++++++++++%3C%2Fport%3E%0A++++++++%3C%2Fservice%3E%0A%3C%2Fdefinitions%3E%0A'
   59     1        INIT_FCALL                                               'file_put_contents'
          2        SEND_VAL                                                 'test.wsdl'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   65     5        DECLARE_CLASS                                            'localsoapclient', 'soapclient'
   85     6        NEW                                              $5      'LocalSoapClient'
          7        SEND_VAL_EX                                              'test.wsdl'
   86     8        SEND_VAL_EX                                              <array>
          9        DO_FCALL                                      0          
   85    10        ASSIGN                                                   !1, $5
   90    11        NEW                                              $8      'Broken'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $8
   91    14        ASSIGN_OBJ                                               !2, 'completelyBroken'
         15        OP_DATA                                                  'indeed+it+is'
   93    16        INIT_FCALL                                               'print_r'
         17        INIT_METHOD_CALL                                         !1, 'f'
         18        SEND_VAR_EX                                              !2
         19        DO_FCALL                                      0  $12     
         20        SEND_VAR                                                 $12
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mqC71
function name:  f
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   61     0  E >   RECV                                             !0      
   62     1      > RETURN                                                   !0
   63     2*     > RETURN                                                   null

End of function f

Class LocalSoapClient:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mqC71
function name:  __construct
number of ops:  17
compiled vars:  !0 = $wsdl, !1 = $options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   66     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   67     2        INIT_STATIC_METHOD_CALL                                  
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   68     6        NEW                                              $4      'SoapServer'
          7        SEND_VAR_EX                                              !0
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN_OBJ                                               'server'
         11        OP_DATA                                                  $4
   69    12        FETCH_OBJ_R                                      ~6      'server'
         13        INIT_METHOD_CALL                                         ~6, 'addFunction'
         14        SEND_VAL_EX                                              'f'
         15        DO_FCALL                                      0          
   70    16      > RETURN                                                   null

End of function __construct

Function __dorequest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mqC71
function name:  __doRequest
number of ops:  18
compiled vars:  !0 = $request, !1 = $location, !2 = $action, !3 = $version, !4 = $one_way, !5 = $response
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   72     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV_INIT                                        !4      0
   73     5        INIT_FCALL                                               'ob_start'
          6        DO_ICALL                                                 
   74     7        FETCH_OBJ_R                                      ~7      'server'
          8        INIT_METHOD_CALL                                         ~7, 'handle'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
   75    11        INIT_FCALL                                               'ob_get_contents'
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !5, $9
   76    14        INIT_FCALL                                               'ob_end_clean'
         15        DO_ICALL                                                 
   77    16      > RETURN                                                   !5
   78    17*     > RETURN                                                   null

End of function __dorequest

End of class LocalSoapClient.

Class Broken: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.67 ms | 1404 KiB | 23 Q