3v4l.org

run code in 500+ PHP versions simultaneously
<?php function ref(&$ref) { var_dump($ref); } class a { function __construct() { $args = array(&$this); for ($i = 0; $i < 2; $i++) { $a = array_slice($args, 0, 1); call_user_func_array('ref', $a); } } }; new a();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MCmnj
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   NEW                                                  $0      'a'
          1        DO_FCALL                                          0          
          2        FREE                                                         $0
          3      > RETURN                                                       1

Function ref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MCmnj
function name:  ref
number of ops:  5
compiled vars:  !0 = $ref
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        INIT_FCALL                                                   'var_dump'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                                     
    5     4      > RETURN                                                       null

End of function ref

Class a:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 5
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 5
Branch analysis from position: 18
Branch analysis from position: 5
filename:       /in/MCmnj
function name:  __construct
number of ops:  19
compiled vars:  !0 = $args, !1 = $i, !2 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   FETCH_THIS                                           $3      
          1        INIT_ARRAY                                           ~4      $3
          2        ASSIGN                                                       !0, ~4
   10     3        ASSIGN                                                       !1, 0
          4      > JMP                                                          ->16
   11     5    >   INIT_FCALL                                                   'array_slice'
          6        SEND_VAR                                                     !0
          7        SEND_VAL                                                     0
          8        SEND_VAL                                                     1
          9        DO_ICALL                                             $7      
         10        ASSIGN                                                       !2, $7
   12    11        INIT_FCALL                                                   'ref'
         12        SEND_ARRAY                                                   !2
         13        CHECK_UNDEF_ARGS                                             
         14        DO_FCALL                                          1          
   10    15        PRE_INC                                                      !1
         16    >   IS_SMALLER                                                   !1, 2
         17      > JMPNZ                                                        ~11, ->5
   14    18    > > RETURN                                                       null

End of function __construct

End of class a.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
212.33 ms | 2836 KiB | 16 Q