3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { public $a; public function __call($method, $args) { call_user_func_array([$this->a, $method], $args); } public function foo() { print 123; } } $a = new test(); $b = new test(); $b->a = $a; $b->foo(); $b->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5TTaS
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   16     3        NEW                                              $5      'test'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   17     6        ASSIGN_OBJ                                               !1, 'a'
          7        OP_DATA                                                  !0
   18     8        INIT_METHOD_CALL                                         !1, 'foo'
          9        DO_FCALL                                      0          
   19    10        INIT_METHOD_CALL                                         !1, 'bar'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class test:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5TTaS
function name:  __call
number of ops:  10
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        FETCH_OBJ_R                                      ~2      'a'
          3        INIT_ARRAY                                       ~3      ~2
          4        ADD_ARRAY_ELEMENT                                ~3      !0
          5        INIT_USER_CALL                                0          'call_user_func_array', ~3
          6        SEND_ARRAY                                               !1
          7        CHECK_UNDEF_ARGS                                         
          8        DO_FCALL                                      0          
    8     9      > RETURN                                                   null

End of function __call

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5TTaS
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     123
   12     1      > RETURN                                                   null

End of function foo

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.31 ms | 1395 KiB | 13 Q