3v4l.org

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

Function return_a:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/Cju1c
function name:  return_a
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_GLOBAL                                              !0, 'a'
    5     1      > RETURN_BY_REF                                            !0
    6     2*     > RETURN_BY_REF                                            null

End of function return_a

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.93 ms | 1398 KiB | 19 Q