3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SoapClientEx extends SoapClient { /** * @var null|SoapServer */ protected $server = null; public function __construct($server, array $options) { parent::__construct(null, $options); $this->server = $server; } public function __doRequest($request, $location, $action, $version, $one_way = 0) { ob_start(); $this->server->handle($request); //header_remove(); return ob_get_clean(); } } class Test { function mult($a, $b) { return $a * $b; } } $server = new SoapServer(null, array( 'uri' => 'localhost' )); $server->setClass('Test'); $client = new SoapClientEx($server, array( 'uri' => 'localhost', 'location' => 'localhost' )); $result = $client->mult(2,3); echo $result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WrcZo
function name:  (null)
number of ops:  21
compiled vars:  !0 = $server, !1 = $client, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                            'soapclientex', 'soapclient'
   33     1        NEW                                              $3      'SoapServer'
          2        SEND_VAL_EX                                              null
   34     3        SEND_VAL_EX                                              <array>
          4        DO_FCALL                                      0          
   33     5        ASSIGN                                                   !0, $3
   36     6        INIT_METHOD_CALL                                         !0, 'setClass'
          7        SEND_VAL_EX                                              'Test'
          8        DO_FCALL                                      0          
   38     9        NEW                                              $7      'SoapClientEx'
         10        SEND_VAR_EX                                              !0
   39    11        SEND_VAL_EX                                              <array>
         12        DO_FCALL                                      0          
   38    13        ASSIGN                                                   !1, $7
   42    14        INIT_METHOD_CALL                                         !1, 'mult'
         15        SEND_VAL_EX                                              2
         16        SEND_VAL_EX                                              3
         17        DO_FCALL                                      0  $10     
         18        ASSIGN                                                   !2, $10
   43    19        ECHO                                                     !2
         20      > RETURN                                                   1

Class SoapClientEx:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WrcZo
function name:  __construct
number of ops:  9
compiled vars:  !0 = $server, !1 = $options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        INIT_STATIC_METHOD_CALL                                  
          3        SEND_VAL_EX                                              null
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   14     6        ASSIGN_OBJ                                               'server'
          7        OP_DATA                                                  !0
   15     8      > 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/WrcZo
function name:  __doRequest
number of ops:  15
compiled vars:  !0 = $request, !1 = $location, !2 = $action, !3 = $version, !4 = $one_way
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV_INIT                                        !4      0
   19     5        INIT_FCALL                                               'ob_start'
          6        DO_ICALL                                                 
   20     7        FETCH_OBJ_R                                      ~6      'server'
          8        INIT_METHOD_CALL                                         ~6, 'handle'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
   22    11        INIT_FCALL                                               'ob_get_clean'
         12        DO_ICALL                                         $8      
         13      > RETURN                                                   $8
   23    14*     > RETURN                                                   null

End of function __dorequest

End of class SoapClientEx.

Class Test:
Function mult:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WrcZo
function name:  mult
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   29     2        MUL                                              ~2      !0, !1
          3      > RETURN                                                   ~2
   30     4*     > RETURN                                                   null

End of function mult

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.73 ms | 1400 KiB | 17 Q