3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($x) { $x[0] = 42; } $c = array(1); $d = array(&$c[0]); $c=0; echo $d[0], "\n"; foo($d); echo $d[0], "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TNgBC
function name:  (null)
number of ops:  15
compiled vars:  !0 = $c, !1 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
    8     1        FETCH_DIM_W                                      $3      !0, 0
          2        INIT_ARRAY                                       ~4      $3
          3        ASSIGN                                                   !1, ~4
    9     4        ASSIGN                                                   !0, 0
   11     5        FETCH_DIM_R                                      ~7      !1, 0
          6        ECHO                                                     ~7
          7        ECHO                                                     '%0A'
   13     8        INIT_FCALL                                               'foo'
          9        SEND_VAR                                                 !1
         10        DO_FCALL                                      0          
   15    11        FETCH_DIM_R                                      ~9      !1, 0
         12        ECHO                                                     ~9
         13        ECHO                                                     '%0A'
         14      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TNgBC
function name:  foo
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN_DIM                                               !0, 0
          2        OP_DATA                                                  42
    5     3      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.67 ms | 1397 KiB | 14 Q