3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ref(&$array) { foreach ($array as $item) { $item; } } $start = microtime(true); $array = range(0, 1000); ref($array); echo 'time: '.(microtime(true) - $start).' sec';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y5YJn
function name:  (null)
number of ops:  20
compiled vars:  !0 = $start, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
   10     4        INIT_FCALL                                               'range'
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 1000
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !1, $4
   11     9        INIT_FCALL                                               'ref'
         10        SEND_REF                                                 !1
         11        DO_FCALL                                      0          
   12    12        INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $7      
         15        SUB                                              ~8      $7, !0
         16        CONCAT                                           ~9      'time%3A+', ~8
         17        CONCAT                                           ~10     ~9, '+sec'
         18        ECHO                                                     ~10
         19      > RETURN                                                   1

Function ref:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/Y5YJn
function name:  ref
number of ops:  6
compiled vars:  !0 = $array, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1      > FE_RESET_R                                       $2      !0, ->4
          2    > > FE_FETCH_R                                               $2, !1, ->4
          3    > > JMP                                                      ->2
          4    >   FE_FREE                                                  $2
    7     5      > RETURN                                                   null

End of function ref

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.65 ms | 1399 KiB | 18 Q