3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Test{ public function testtreit(){ return 'Это трейт !'; } } class MyProxy { protected $_object = null; protected $_methods = array(); public function __construct($object) { if (!is_object($object)) { throw new InvalidArgumentException('$object must be an object'); } $this->_object = $object; } public function __call($name, $arguments) { return $this->callMethod($name, $arguments); } public function setMethod($name, Closure $method) { $this->_methods[(string) $key] = $method; } public function callMethod($name, array $arguments) { if (isset($this->_methods[$name])) { return call_user_func_array($this->_methods[$name], $arguments); } return call_user_func_array(array($this->_object, $name), $arguments); } } $ar = new MyProxy(); $ar->testtreit(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UX2EI
function name:  (null)
number of ops:  6
compiled vars:  !0 = $ar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   NEW                                              $1      'MyProxy'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   38     3        INIT_METHOD_CALL                                         !0, 'testtreit'
          4        DO_FCALL                                      0          
   39     5      > RETURN                                                   1

Class Test:
Function testtreit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UX2EI
function name:  testtreit
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   '%D0%AD%D1%82%D0%BE+%D1%82%D1%80%D0%B5%D0%B9%D1%82+%21'
    5     1*     > RETURN                                                   null

End of function testtreit

End of class Test.

Class MyProxy:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UX2EI
function name:  __construct
number of ops:  11
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        TYPE_CHECK                                  256  ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->8
   15     4    >   NEW                                              $3      'InvalidArgumentException'
          5        SEND_VAL_EX                                              '%24object+must+be+an+object'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $3
   17     8    >   ASSIGN_OBJ                                               '_object'
          9        OP_DATA                                                  !0
   18    10      > RETURN                                                   null

End of function __construct

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UX2EI
function name:  __call
number of ops:  8
compiled vars:  !0 = $name, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   21     2        INIT_METHOD_CALL                                         'callMethod'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0  $2      
          6      > RETURN                                                   $2
   22     7*     > RETURN                                                   null

End of function __call

Function setmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UX2EI
function name:  setMethod
number of ops:  7
compiled vars:  !0 = $name, !1 = $method, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   25     2        CAST                                          6  ~4      !2
          3        FETCH_OBJ_W                                      $3      '_methods'
          4        ASSIGN_DIM                                               $3, ~4
          5        OP_DATA                                                  !1
   26     6      > RETURN                                                   null

End of function setmethod

Function callmethod:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UX2EI
function name:  callMethod
number of ops:  21
compiled vars:  !0 = $name, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   29     2        FETCH_OBJ_IS                                     ~2      '_methods'
          3        ISSET_ISEMPTY_DIM_OBJ                         0          ~2, !0
          4      > JMPZ                                                     ~3, ->12
   30     5    >   FETCH_OBJ_R                                      ~4      '_methods'
          6        FETCH_DIM_R                                      ~5      ~4, !0
          7        INIT_USER_CALL                                0          'call_user_func_array', ~5
          8        SEND_ARRAY                                               !1
          9        CHECK_UNDEF_ARGS                                         
         10        DO_FCALL                                      0  $6      
         11      > RETURN                                                   $6
   32    12    >   FETCH_OBJ_R                                      ~7      '_object'
         13        INIT_ARRAY                                       ~8      ~7
         14        ADD_ARRAY_ELEMENT                                ~8      !0
         15        INIT_USER_CALL                                0          'call_user_func_array', ~8
         16        SEND_ARRAY                                               !1
         17        CHECK_UNDEF_ARGS                                         
         18        DO_FCALL                                      0  $9      
         19      > RETURN                                                   $9
   33    20*     > RETURN                                                   null

End of function callmethod

End of class MyProxy.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.74 ms | 1399 KiB | 13 Q