3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test_one(&$arr) { $arr = array_reverse($arr); } function test_two(&$arr) { $arr =& array_reverse($arr); } $arr1 = array(1,2,3); $arr2 = array(4,5,6); test_one($arr1); test_two($arr2); print_r($arr1); print_r($arr2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qPfgb
function name:  (null)
number of ops:  15
compiled vars:  !0 = $arr1, !1 = $arr2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   12     2        INIT_FCALL                                               'test_one'
          3        SEND_REF                                                 !0
          4        DO_FCALL                                      0          
   13     5        INIT_FCALL                                               'test_two'
          6        SEND_REF                                                 !1
          7        DO_FCALL                                      0          
   14     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   15    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

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

End of function test_one

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

End of function test_two

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.98 ms | 1403 KiB | 19 Q