3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(version_compare(PHP_VERSION, '5.0') <= 0) { die('Skipped'); } // Setup $class = 'Concrete5_Model_User'; $count = 1000; // Warm up for($i = 0; $i < $count; $i++) { strpos($class, 'Concrete5_Model'); } // Test - case sensitive $t0 = microtime(true); for($i = 0; $i < $count; $i++) { strpos($class, 'Concrete5_Model'); } $deltaCS = microtime(true) - $t0; // Test - case insensitive $t0 = microtime(true); for($i = 0; $i < $count; $i++) { stripos($class, 'Concrete5_Model'); } $deltaCI = microtime(true) - $t0; echo "case sensitive: ", round($deltaCS * 1000, 2), "\n"; echo "case insensitive: ", round($deltaCI * 1000, 2), "\n"; echo "ratio: ", round($deltaCS * 100 / $deltaCI, 2), "%\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 11
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 24
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 42
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 42
Branch analysis from position: 49
Branch analysis from position: 42
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 24
Branch analysis from position: 31
Branch analysis from position: 24
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 11
Branch analysis from position: 18
Branch analysis from position: 11
filename:       /in/0oJEU
function name:  (null)
number of ops:  80
compiled vars:  !0 = $class, !1 = $count, !2 = $i, !3 = $t0, !4 = $deltaCS, !5 = $deltaCI
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'version_compare'
          1        SEND_VAL                                                 '8.0.0'
          2        SEND_VAL                                                 '5.0'
          3        DO_ICALL                                         $6      
          4        IS_SMALLER_OR_EQUAL                                      $6, 0
          5      > JMPZ                                                     ~7, ->7
    3     6    > > EXIT                                                     'Skipped'
    6     7    >   ASSIGN                                                   !0, 'Concrete5_Model_User'
    7     8        ASSIGN                                                   !1, 1000
   10     9        ASSIGN                                                   !2, 0
         10      > JMP                                                      ->16
   11    11    >   INIT_FCALL                                               'strpos'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 'Concrete5_Model'
         14        DO_ICALL                                                 
   10    15        PRE_INC                                                  !2
         16    >   IS_SMALLER                                               !2, !1
         17      > JMPNZ                                                    ~13, ->11
   15    18    >   INIT_FCALL                                               'microtime'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $14     
         21        ASSIGN                                                   !3, $14
   16    22        ASSIGN                                                   !2, 0
         23      > JMP                                                      ->29
   17    24    >   INIT_FCALL                                               'strpos'
         25        SEND_VAR                                                 !0
         26        SEND_VAL                                                 'Concrete5_Model'
         27        DO_ICALL                                                 
   16    28        PRE_INC                                                  !2
         29    >   IS_SMALLER                                               !2, !1
         30      > JMPNZ                                                    ~19, ->24
   19    31    >   INIT_FCALL                                               'microtime'
         32        SEND_VAL                                                 <true>
         33        DO_ICALL                                         $20     
         34        SUB                                              ~21     $20, !3
         35        ASSIGN                                                   !4, ~21
   23    36        INIT_FCALL                                               'microtime'
         37        SEND_VAL                                                 <true>
         38        DO_ICALL                                         $23     
         39        ASSIGN                                                   !3, $23
   24    40        ASSIGN                                                   !2, 0
         41      > JMP                                                      ->47
   25    42    >   INIT_FCALL                                               'stripos'
         43        SEND_VAR                                                 !0
         44        SEND_VAL                                                 'Concrete5_Model'
         45        DO_ICALL                                                 
   24    46        PRE_INC                                                  !2
         47    >   IS_SMALLER                                               !2, !1
         48      > JMPNZ                                                    ~28, ->42
   27    49    >   INIT_FCALL                                               'microtime'
         50        SEND_VAL                                                 <true>
         51        DO_ICALL                                         $29     
         52        SUB                                              ~30     $29, !3
         53        ASSIGN                                                   !5, ~30
   29    54        ECHO                                                     'case+sensitive%3A+'
         55        INIT_FCALL                                               'round'
         56        MUL                                              ~32     !4, 1000
         57        SEND_VAL                                                 ~32
         58        SEND_VAL                                                 2
         59        DO_ICALL                                         $33     
         60        ECHO                                                     $33
         61        ECHO                                                     '%0A'
   30    62        ECHO                                                     'case+insensitive%3A+'
         63        INIT_FCALL                                               'round'
         64        MUL                                              ~34     !5, 1000
         65        SEND_VAL                                                 ~34
         66        SEND_VAL                                                 2
         67        DO_ICALL                                         $35     
         68        ECHO                                                     $35
         69        ECHO                                                     '%0A'
   31    70        ECHO                                                     'ratio%3A+'
         71        INIT_FCALL                                               'round'
         72        MUL                                              ~36     !4, 100
         73        DIV                                              ~37     ~36, !5
         74        SEND_VAL                                                 ~37
         75        SEND_VAL                                                 2
         76        DO_ICALL                                         $38     
         77        ECHO                                                     $38
         78        ECHO                                                     '%25%0A'
         79      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.29 ms | 1404 KiB | 23 Q