3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { private function test(&$ref) { $ref++; } public function __call($f, $a) { foreach ($a as $k => &$v); call_user_func_array(array($this, $f), $a); } } $x = 10; $a = new a(); $a->test($x); echo $x;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JHekR
function name:  (null)
number of ops:  9
compiled vars:  !0 = $x, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, 10
   19     1        NEW                                              $3      'a'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
   20     4        INIT_METHOD_CALL                                         !1, 'test'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   21     7        ECHO                                                     !0
          8      > RETURN                                                   1

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

End of function test

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/JHekR
function name:  __call
number of ops:  15
compiled vars:  !0 = $f, !1 = $a, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2      > FE_RESET_RW                                      $4      !1, ->6
          3    > > FE_FETCH_RW                                      ~5      $4, !2, ->6
          4    >   ASSIGN                                                   !3, ~5
          5      > JMP                                                      ->3
          6    >   FE_FREE                                                  $4
   14     7        FETCH_THIS                                       ~7      
          8        INIT_ARRAY                                       ~8      ~7
          9        ADD_ARRAY_ELEMENT                                ~8      !0
         10        INIT_USER_CALL                                0          'call_user_func_array', ~8
         11        SEND_ARRAY                                               !1
         12        CHECK_UNDEF_ARGS                                         
         13        DO_FCALL                                      0          
   15    14      > RETURN                                                   null

End of function __call

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.7 ms | 1395 KiB | 13 Q