3v4l.org

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

Function collector:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/5nSY0
function name:  collector
number of ops:  3
compiled vars:  !0 = $collection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   BIND_STATIC                                              !0
    4     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:
160.79 ms | 1389 KiB | 16 Q