3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 'foo'; $b = 'bar'; $array = [&$a, $b]; var_dump($array); $newArray = array_map(function(&$item){ $a = &$item; return $a; }, $array); var_dump($newArray);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vk046
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $b, !2 = $array, !3 = $newArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'foo'
    4     1        ASSIGN                                                   !1, 'bar'
    5     2        INIT_ARRAY                                       ~6      !0
          3        ADD_ARRAY_ELEMENT                                ~6      !1
          4        ASSIGN                                                   !2, ~6
    7     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                                 
    9     8        INIT_FCALL                                               'array_map'
          9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fvk046%3A9%240'
   12    10        SEND_VAL                                                 ~9
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $10     
    9    13        ASSIGN                                                   !3, $10
   15    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fvk046%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vk046
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $item, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        ASSIGN_REF                                               !1, !0
   11     2      > RETURN                                                   !1
   12     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fvk046%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.68 ms | 1395 KiB | 17 Q