3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = microtime(true); $stack = new SplStack(); $array = []; for ($i = 0; $i < 1000000; ++$i) { $stack->push($i); // $array[] = $i; } $tmp = 0; for ($i = 0; $i < 1000000; ++$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 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 10
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 19
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 19
Branch analysis from position: 25
Branch analysis from position: 19
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 10
Branch analysis from position: 16
Branch analysis from position: 10
filename:       /in/bqsrV
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                                                      ->14
    8    10    >   INIT_METHOD_CALL                                         !1, 'push'
         11        SEND_VAR_EX                                              !3
         12        DO_FCALL                                      0          
    7    13        PRE_INC                                                  !3
         14    >   IS_SMALLER                                               !3, 1000000
         15      > JMPNZ                                                    ~14, ->10
   12    16    >   ASSIGN                                                   !4, 0
   13    17        ASSIGN                                                   !3, 0
         18      > JMP                                                      ->23
   14    19    >   INIT_METHOD_CALL                                         !1, 'pop'
         20        DO_FCALL                                      0  $17     
         21        ASSIGN                                                   !4, $17
   13    22        PRE_INC                                                  !3
         23    >   IS_SMALLER                                               !3, 1000000
         24      > JMPNZ                                                    ~20, ->19
   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:
142.08 ms | 1396 KiB | 15 Q