3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(1,2,3); function byvalue($arg) { $arr[0] = 10; } byvalue($arg); var_dump($arr); // no change call_user_func_array('byvalue', array(&$arg)); var_dump($arr); // no change
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1LZmF
function name:  (null)
number of ops:  16
compiled vars:  !0 = $arr, !1 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    6     1        INIT_FCALL                                               'byvalue'
          2        SEND_VAR                                                 !1
          3        DO_FCALL                                      0          
    7     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
    8     7        INIT_FCALL                                               'byvalue'
          8        INIT_ARRAY                                       ~5      !1
          9        SEND_ARRAY                                               ~5
         10        CHECK_UNDEF_ARGS                                         
         11        DO_FCALL                                      0          
    9    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

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

End of function byvalue

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.99 ms | 1397 KiB | 17 Q