3v4l.org

run code in 300+ PHP versions simultaneously
<?php $count = 100000; $a = array(); for ($i = 0; $i < $count; $i++) { if ($i % 2) { $a['key_' . $i] = 'ok'; } } $time = microtime(true); $result = 0; for ($i = 0; $i < $count; $i++) { if (isset($a['key_' . $i])) { ++$result; } } $time = microtime(true) - $time; echo number_format($time, 3) . ' seconds and returned ' . $result . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 4
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 19
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 23
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 19
Branch analysis from position: 26
Branch analysis from position: 19
Branch analysis from position: 23
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 4
Branch analysis from position: 12
Branch analysis from position: 4
Branch analysis from position: 9
filename:       /in/2Y4AF
function name:  (null)
number of ops:  40
compiled vars:  !0 = $count, !1 = $a, !2 = $i, !3 = $time, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 100000
    5     1        ASSIGN                                                   !1, <array>
    7     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->10
    8     4    >   MOD                                              ~8      !2, 2
          5      > JMPZ                                                     ~8, ->9
    9     6    >   CONCAT                                           ~9      'key_', !2
          7        ASSIGN_DIM                                               !1, ~9
          8        OP_DATA                                                  'ok'
    7     9    >   PRE_INC                                                  !2
         10    >   IS_SMALLER                                               !2, !0
         11      > JMPNZ                                                    ~12, ->4
   13    12    >   INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $13     
         15        ASSIGN                                                   !3, $13
   15    16        ASSIGN                                                   !4, 0
   17    17        ASSIGN                                                   !2, 0
         18      > JMP                                                      ->24
   18    19    >   CONCAT                                           ~17     'key_', !2
         20        ISSET_ISEMPTY_DIM_OBJ                         0          !1, ~17
         21      > JMPZ                                                     ~18, ->23
   19    22    >   PRE_INC                                                  !4
   17    23    >   PRE_INC                                                  !2
         24    >   IS_SMALLER                                               !2, !0
         25      > JMPNZ                                                    ~21, ->19
   23    26    >   INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $22     
         29        SUB                                              ~23     $22, !3
         30        ASSIGN                                                   !3, ~23
   25    31        INIT_FCALL                                               'number_format'
         32        SEND_VAR                                                 !3
         33        SEND_VAL                                                 3
         34        DO_ICALL                                         $25     
         35        CONCAT                                           ~26     $25, '+seconds+and+returned+'
         36        CONCAT                                           ~27     ~26, !4
         37        CONCAT                                           ~28     ~27, '%0A'
         38        ECHO                                                     ~28
         39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.23 ms | 1400 KiB | 17 Q