3v4l.org

run code in 300+ PHP versions simultaneously
<?php $range = range(1,100000); $start_time = microtime(true); array_shift($range); $end_time = microtime(true); echo "array_shift:" . ($end_time - $start_time); echo "\n\n"; $start_time = microtime(); count($range); $end_time = microtime(); echo "count: " . ($end_time - $start_time);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S6SU4
function name:  (null)
number of ops:  32
compiled vars:  !0 = $range, !1 = $start_time, !2 = $end_time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 100000
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    5     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !1, $5
    7     9        INIT_FCALL                                               'array_shift'
         10        SEND_REF                                                 !0
         11        DO_ICALL                                                 
    9    12        INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $8      
         15        ASSIGN                                                   !2, $8
   11    16        SUB                                              ~10     !2, !1
         17        CONCAT                                           ~11     'array_shift%3A', ~10
         18        ECHO                                                     ~11
   13    19        ECHO                                                     '%0A%0A'
   15    20        INIT_FCALL                                               'microtime'
         21        DO_ICALL                                         $12     
         22        ASSIGN                                                   !1, $12
   17    23        COUNT                                            ~14     !0
         24        FREE                                                     ~14
   19    25        INIT_FCALL                                               'microtime'
         26        DO_ICALL                                         $15     
         27        ASSIGN                                                   !2, $15
   21    28        SUB                                              ~17     !2, !1
         29        CONCAT                                           ~18     'count%3A+', ~17
         30        ECHO                                                     ~18
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.27 ms | 1396 KiB | 19 Q