3v4l.org

run code in 300+ PHP versions simultaneously
<?php $count = 100000; $a = array(); for ($i = 0; $i < $count; $i++) { if ($i % 2) { $a[$i] = 'ok'; } } $time = microtime(true); $result = 0; for ($i = 0; $i < $count; $i++) { if (array_key_exists($i, $a)) { ++$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 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 4
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 18
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 18
Branch analysis from position: 24
Branch analysis from position: 18
Branch analysis from position: 21
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 4
Branch analysis from position: 11
Branch analysis from position: 4
Branch analysis from position: 8
filename:       /in/UYYeU
function name:  (null)
number of ops:  38
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                                                      ->9
    8     4    >   MOD                                              ~8      !2, 2
          5      > JMPZ                                                     ~8, ->8
    9     6    >   ASSIGN_DIM                                               !1, !2
          7        OP_DATA                                                  'ok'
    7     8    >   PRE_INC                                                  !2
          9    >   IS_SMALLER                                               !2, !0
         10      > JMPNZ                                                    ~11, ->4
   13    11    >   INIT_FCALL                                               'microtime'
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $12     
         14        ASSIGN                                                   !3, $12
   15    15        ASSIGN                                                   !4, 0
   17    16        ASSIGN                                                   !2, 0
         17      > JMP                                                      ->22
   18    18    >   ARRAY_KEY_EXISTS                                         !2, !1
         19      > JMPZ                                                     ~16, ->21
   19    20    >   PRE_INC                                                  !4
   17    21    >   PRE_INC                                                  !2
         22    >   IS_SMALLER                                               !2, !0
         23      > JMPNZ                                                    ~19, ->18
   23    24    >   INIT_FCALL                                               'microtime'
         25        SEND_VAL                                                 <true>
         26        DO_ICALL                                         $20     
         27        SUB                                              ~21     $20, !3
         28        ASSIGN                                                   !3, ~21
   25    29        INIT_FCALL                                               'number_format'
         30        SEND_VAR                                                 !3
         31        SEND_VAL                                                 3
         32        DO_ICALL                                         $23     
         33        CONCAT                                           ~24     $23, '+seconds+and+returned+'
         34        CONCAT                                           ~25     ~24, !4
         35        CONCAT                                           ~26     ~25, '%0A'
         36        ECHO                                                     ~26
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.38 ms | 1400 KiB | 17 Q