3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = microtime(true); $stack = new SplStack(); $array = []; for ($i = 0; $i < 100000; ++$i) { //$stack->push($i); $array[] = $i; } $tmp = 0; for ($i = 0; $i < 100000; ++$i) { //$tmp = $stack->pop(); $tmp = array_pop($array); } echo microtime(true) - $start;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 10
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 18
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 18
Branch analysis from position: 25
Branch analysis from position: 18
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 10
Branch analysis from position: 15
Branch analysis from position: 10
filename:       /in/6Df7k
function name:  (null)
number of ops:  31
compiled vars:  !0 = $start, !1 = $stack, !2 = $array, !3 = $i, !4 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    4     4        NEW                                              $7      'SplStack'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $7
    5     7        ASSIGN                                                   !2, <array>
    7     8        ASSIGN                                                   !3, 0
          9      > JMP                                                      ->13
    9    10    >   ASSIGN_DIM                                               !2
         11        OP_DATA                                                  !3
    7    12        PRE_INC                                                  !3
         13    >   IS_SMALLER                                               !3, 100000
         14      > JMPNZ                                                    ~14, ->10
   12    15    >   ASSIGN                                                   !4, 0
   13    16        ASSIGN                                                   !3, 0
         17      > JMP                                                      ->23
   15    18    >   INIT_FCALL                                               'array_pop'
         19        SEND_REF                                                 !2
         20        DO_ICALL                                         $17     
         21        ASSIGN                                                   !4, $17
   13    22        PRE_INC                                                  !3
         23    >   IS_SMALLER                                               !3, 100000
         24      > JMPNZ                                                    ~20, ->18
   18    25    >   INIT_FCALL                                               'microtime'
         26        SEND_VAL                                                 <true>
         27        DO_ICALL                                         $21     
         28        SUB                                              ~22     $21, !0
         29        ECHO                                                     ~22
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.89 ms | 1396 KiB | 17 Q