3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = range(0, 262); $start = microtime(true); for ($i = 0; $i < 1000000; $i++) { in_array(42, $arr); } $time_1 = microtime(true) - $start; $arr = []; for ($i = 0; $i < 263; $i++) { $arr[$i] = ''; } $start = microtime(true); for ($i = 0; $i < 1000000; $i++) { isset($arr[42]); } $time_2 = microtime(true) - $start; echo "in_array : $time_1\r\n"; echo "isset : $time_2\r\n";
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 = 11
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 24
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 35
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 35
Branch analysis from position: 40
Branch analysis from position: 35
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 24
Branch analysis from position: 29
Branch analysis from position: 24
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 11
Branch analysis from position: 16
Branch analysis from position: 11
filename:       /in/ctKEL
function name:  (null)
number of ops:  54
compiled vars:  !0 = $arr, !1 = $start, !2 = $i, !3 = $time_1, !4 = $time_2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'range'
          1        SEND_VAL                                                     0
          2        SEND_VAL                                                     262
          3        DO_ICALL                                             $5      
          4        ASSIGN                                                       !0, $5
    4     5        INIT_FCALL                                                   'microtime'
          6        SEND_VAL                                                     <true>
          7        DO_ICALL                                             $7      
          8        ASSIGN                                                       !1, $7
    5     9        ASSIGN                                                       !2, 0
         10      > JMP                                                          ->14
    6    11    >   FRAMELESS_ICALL_2                in_array            ~10     42, !0
         12        FREE                                                         ~10
    5    13        PRE_INC                                                      !2
         14    >   IS_SMALLER                                                   !2, 1000000
         15      > JMPNZ                                                        ~12, ->11
    8    16    >   INIT_FCALL                                                   'microtime'
         17        SEND_VAL                                                     <true>
         18        DO_ICALL                                             $13     
         19        SUB                                                  ~14     $13, !1
         20        ASSIGN                                                       !3, ~14
   10    21        ASSIGN                                                       !0, <array>
   11    22        ASSIGN                                                       !2, 0
         23      > JMP                                                          ->27
   12    24    >   ASSIGN_DIM                                                   !0, !2
         25        OP_DATA                                                      ''
   11    26        PRE_INC                                                      !2
         27    >   IS_SMALLER                                                   !2, 263
         28      > JMPNZ                                                        ~20, ->24
   15    29    >   INIT_FCALL                                                   'microtime'
         30        SEND_VAL                                                     <true>
         31        DO_ICALL                                             $21     
         32        ASSIGN                                                       !1, $21
   16    33        ASSIGN                                                       !2, 0
         34      > JMP                                                          ->38
   17    35    >   ISSET_ISEMPTY_DIM_OBJ                             0  ~24     !0, 42
         36        FREE                                                         ~24
   16    37        PRE_INC                                                      !2
         38    >   IS_SMALLER                                                   !2, 1000000
         39      > JMPNZ                                                        ~26, ->35
   19    40    >   INIT_FCALL                                                   'microtime'
         41        SEND_VAL                                                     <true>
         42        DO_ICALL                                             $27     
         43        SUB                                                  ~28     $27, !1
         44        ASSIGN                                                       !4, ~28
   22    45        ROPE_INIT                                         3  ~31     'in_array+%3A+'
         46        ROPE_ADD                                          1  ~31     ~31, !3
         47        ROPE_END                                          2  ~30     ~31, '%0D%0A'
         48        ECHO                                                         ~30
   23    49        ROPE_INIT                                         3  ~34     'isset++++%3A+'
         50        ROPE_ADD                                          1  ~34     ~34, !4
         51        ROPE_END                                          2  ~33     ~34, '%0D%0A'
         52        ECHO                                                         ~33
         53      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.6 ms | 1302 KiB | 15 Q