3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i = 0; $runs = 1000; $arr1 = array('foo', 'bar', 'foobar'); $arr2 = array('foo', 'bar', 'foobar', '*'); $start = microtime(true); for ($i = 0; $i < $runs; $i++) { in_array('*', $arr1); } $end = microtime(true); echo sprintf("non-strict in_array without match: %f\n", $end-$start); $start = microtime(true); for ($i = 0; $i < $runs; $i++) { in_array('*', $arr2); } $end = microtime(true); echo sprintf("non-strict in_array with match: %f\n", $end-$start); $start = microtime(true); for ($i = 0; $i < $runs; $i++) { in_array('*', $arr1, true); } $end = microtime(true); echo sprintf("strict in_array without match: %f\n", $end-$start); $start = microtime(true); for ($i = 0; $i < $runs; $i++) { in_array('*', $arr2, true); } $end = microtime(true); echo sprintf("strict in_array with match: %f\n", $end-$start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 10
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 33
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 56
Branch analysis from position: 64
1 jumps found. (Code = 42) Position 1 = 86
Branch analysis from position: 86
2 jumps found. (Code = 44) Position 1 = 88, Position 2 = 80
Branch analysis from position: 88
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 80
2 jumps found. (Code = 44) Position 1 = 88, Position 2 = 80
Branch analysis from position: 88
Branch analysis from position: 80
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 56
Branch analysis from position: 64
Branch analysis from position: 56
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 33
Branch analysis from position: 40
Branch analysis from position: 33
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 10
Branch analysis from position: 17
Branch analysis from position: 10
filename:       /in/N1MYD
function name:  (null)
number of ops:  99
compiled vars:  !0 = $i, !1 = $runs, !2 = $arr1, !3 = $arr2, !4 = $start, !5 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
    4     1        ASSIGN                                                   !1, 1000
    5     2        ASSIGN                                                   !2, <array>
    6     3        ASSIGN                                                   !3, <array>
    8     4        INIT_FCALL                                               'microtime'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $10     
          7        ASSIGN                                                   !4, $10
    9     8        ASSIGN                                                   !0, 0
          9      > JMP                                                      ->15
   10    10    >   INIT_FCALL                                               'in_array'
         11        SEND_VAL                                                 '%2A'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
    9    14        PRE_INC                                                  !0
         15    >   IS_SMALLER                                               !0, !1
         16      > JMPNZ                                                    ~15, ->10
   12    17    >   INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $16     
         20        ASSIGN                                                   !5, $16
   13    21        INIT_FCALL                                               'sprintf'
         22        SEND_VAL                                                 'non-strict+in_array+without+match%3A+%25f%0A'
         23        SUB                                              ~18     !5, !4
         24        SEND_VAL                                                 ~18
         25        DO_ICALL                                         $19     
         26        ECHO                                                     $19
   15    27        INIT_FCALL                                               'microtime'
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $20     
         30        ASSIGN                                                   !4, $20
   16    31        ASSIGN                                                   !0, 0
         32      > JMP                                                      ->38
   17    33    >   INIT_FCALL                                               'in_array'
         34        SEND_VAL                                                 '%2A'
         35        SEND_VAR                                                 !3
         36        DO_ICALL                                                 
   16    37        PRE_INC                                                  !0
         38    >   IS_SMALLER                                               !0, !1
         39      > JMPNZ                                                    ~25, ->33
   19    40    >   INIT_FCALL                                               'microtime'
         41        SEND_VAL                                                 <true>
         42        DO_ICALL                                         $26     
         43        ASSIGN                                                   !5, $26
   20    44        INIT_FCALL                                               'sprintf'
         45        SEND_VAL                                                 'non-strict+in_array+with+match%3A+%25f%0A'
         46        SUB                                              ~28     !5, !4
         47        SEND_VAL                                                 ~28
         48        DO_ICALL                                         $29     
         49        ECHO                                                     $29
   22    50        INIT_FCALL                                               'microtime'
         51        SEND_VAL                                                 <true>
         52        DO_ICALL                                         $30     
         53        ASSIGN                                                   !4, $30
   23    54        ASSIGN                                                   !0, 0
         55      > JMP                                                      ->62
   24    56    >   INIT_FCALL                                               'in_array'
         57        SEND_VAL                                                 '%2A'
         58        SEND_VAR                                                 !2
         59        SEND_VAL                                                 <true>
         60        DO_ICALL                                                 
   23    61        PRE_INC                                                  !0
         62    >   IS_SMALLER                                               !0, !1
         63      > JMPNZ                                                    ~35, ->56
   26    64    >   INIT_FCALL                                               'microtime'
         65        SEND_VAL                                                 <true>
         66        DO_ICALL                                         $36     
         67        ASSIGN                                                   !5, $36
   27    68        INIT_FCALL                                               'sprintf'
         69        SEND_VAL                                                 'strict+in_array+without+match%3A+%25f%0A'
         70        SUB                                              ~38     !5, !4
         71        SEND_VAL                                                 ~38
         72        DO_ICALL                                         $39     
         73        ECHO                                                     $39
   29    74        INIT_FCALL                                               'microtime'
         75        SEND_VAL                                                 <true>
         76        DO_ICALL                                         $40     
         77        ASSIGN                                                   !4, $40
   30    78        ASSIGN                                                   !0, 0
         79      > JMP                                                      ->86
   31    80    >   INIT_FCALL                                               'in_array'
         81        SEND_VAL                                                 '%2A'
         82        SEND_VAR                                                 !3
         83        SEND_VAL                                                 <true>
         84        DO_ICALL                                                 
   30    85        PRE_INC                                                  !0
         86    >   IS_SMALLER                                               !0, !1
         87      > JMPNZ                                                    ~45, ->80
   33    88    >   INIT_FCALL                                               'microtime'
         89        SEND_VAL                                                 <true>
         90        DO_ICALL                                         $46     
         91        ASSIGN                                                   !5, $46
   34    92        INIT_FCALL                                               'sprintf'
         93        SEND_VAL                                                 'strict+in_array+with+match%3A+%25f%0A'
         94        SUB                                              ~48     !5, !4
         95        SEND_VAL                                                 ~48
         96        DO_ICALL                                         $49     
         97        ECHO                                                     $49
         98      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.26 ms | 1409 KiB | 19 Q