3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = $b = array_fill(0, 500, 'sucks'); $t = microtime(true); $c = array_reverse($a); while($c) { array_pop($c); } var_dump(microtime(true) - $t); $t = microtime(true); while($b) { array_shift($b); } var_dump(microtime(true) - $t);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 16
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 32
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 32
Branch analysis from position: 36
Branch analysis from position: 32
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 16
Branch analysis from position: 20
Branch analysis from position: 16
filename:       /in/I3lmb
function name:  (null)
number of ops:  44
compiled vars:  !0 = $a, !1 = $b, !2 = $t, !3 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'array_fill'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 500
          3        SEND_VAL                                                 'sucks'
          4        DO_ICALL                                         $4      
          5        ASSIGN                                           ~5      !1, $4
          6        ASSIGN                                                   !0, ~5
    4     7        INIT_FCALL                                               'microtime'
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !2, $7
    5    11        INIT_FCALL                                               'array_reverse'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $9      
         14        ASSIGN                                                   !3, $9
    6    15      > JMP                                                      ->19
    7    16    >   INIT_FCALL                                               'array_pop'
         17        SEND_REF                                                 !3
         18        DO_ICALL                                                 
    6    19    > > JMPNZ                                                    !3, ->16
    9    20    >   INIT_FCALL                                               'var_dump'
         21        INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $12     
         24        SUB                                              ~13     $12, !2
         25        SEND_VAL                                                 ~13
         26        DO_ICALL                                                 
   11    27        INIT_FCALL                                               'microtime'
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $15     
         30        ASSIGN                                                   !2, $15
   12    31      > JMP                                                      ->35
   13    32    >   INIT_FCALL                                               'array_shift'
         33        SEND_REF                                                 !1
         34        DO_ICALL                                                 
   12    35    > > JMPNZ                                                    !1, ->32
   15    36    >   INIT_FCALL                                               'var_dump'
         37        INIT_FCALL                                               'microtime'
         38        SEND_VAL                                                 <true>
         39        DO_ICALL                                         $18     
         40        SUB                                              ~19     $18, !2
         41        SEND_VAL                                                 ~19
         42        DO_ICALL                                                 
         43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.52 ms | 1400 KiB | 25 Q