3v4l.org

run code in 300+ PHP versions simultaneously
<?php function &collector() { static $collection = array(); return $collection; } array_push(collector(), 'foo'); print_r(collector());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mEEK0
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'array_push'
          1        INIT_FCALL                                               'collector'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR_NO_REF                               0          $0
          4        SEND_VAL                                                 'foo'
          5        DO_ICALL                                                 
   10     6        INIT_FCALL                                               'print_r'
          7        INIT_FCALL                                               'collector'
          8        DO_FCALL                                      0  $2      
          9        SEND_VAR                                                 $2
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

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

End of function collector

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.19 ms | 1397 KiB | 19 Q