3v4l.org

run code in 300+ PHP versions simultaneously
<?php $v1 = 5; $v2 = '5-4'; $class = 'Concrete5_Controller_Name'; // Let's warm up while(++$i < 100000) { if(0) {} } // Test 'else if' $i = 0; $start = microtime(true); while(++$i < 1000000) { preg_match('/^Concrete5_Model_(.*)/i', $class); preg_match('/^Concrete5_Helper_(.*)/i', $class); preg_match('/^Concrete5_Controller_Block_(.*)/i', $class); } $end = microtime(true); echo "preg_match: ".($end - $start)."\n"; unset($start, $end); // Test 'elseif' $i = 0; $start = microtime(true); while(++$i < 1000000) { stripos($class, 'Concrete5_Model_'); stripos($class, 'Concrete5_Helper_'); stripos($class, 'Concrete5_Controller_Block_'); } $end = microtime(true); echo "stripos: ".($end - $start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 4
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 14
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 60, Position 2 = 45
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 60, Position 2 = 45
Branch analysis from position: 60
Branch analysis from position: 45
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 14
Branch analysis from position: 29
Branch analysis from position: 14
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 5
Branch analysis from position: 5
Branch analysis from position: 5
filename:       /in/mtQQ3
function name:  (null)
number of ops:  68
compiled vars:  !0 = $v1, !1 = $v2, !2 = $class, !3 = $i, !4 = $start, !5 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 5
    3     1        ASSIGN                                                   !1, '5-4'
    5     2        ASSIGN                                                   !2, 'Concrete5_Controller_Name'
    7     3      > JMP                                                      ->5
          4    > > JMPZ                                                     0, ->5
          5    >   PRE_INC                                          ~9      !3
          6        IS_SMALLER                                               ~9, 100000
          7      > JMPNZ                                                    ~10, ->4
    9     8    >   ASSIGN                                                   !3, 0
   10     9        INIT_FCALL                                               'microtime'
         10        SEND_VAL                                                 <true>
         11        DO_ICALL                                         $12     
         12        ASSIGN                                                   !4, $12
   11    13      > JMP                                                      ->26
         14    >   INIT_FCALL                                               'preg_match'
         15        SEND_VAL                                                 '%2F%5EConcrete5_Model_%28.%2A%29%2Fi'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
         18        INIT_FCALL                                               'preg_match'
         19        SEND_VAL                                                 '%2F%5EConcrete5_Helper_%28.%2A%29%2Fi'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                                 
         22        INIT_FCALL                                               'preg_match'
         23        SEND_VAL                                                 '%2F%5EConcrete5_Controller_Block_%28.%2A%29%2Fi'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                                 
         26    >   PRE_INC                                          ~17     !3
         27        IS_SMALLER                                               ~17, 1000000
         28      > JMPNZ                                                    ~18, ->14
   12    29    >   INIT_FCALL                                               'microtime'
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                         $19     
         32        ASSIGN                                                   !5, $19
   13    33        SUB                                              ~21     !5, !4
         34        CONCAT                                           ~22     'preg_match%3A+', ~21
         35        CONCAT                                           ~23     ~22, '%0A'
         36        ECHO                                                     ~23
   14    37        UNSET_CV                                                 !4
         38        UNSET_CV                                                 !5
   16    39        ASSIGN                                                   !3, 0
   17    40        INIT_FCALL                                               'microtime'
         41        SEND_VAL                                                 <true>
         42        DO_ICALL                                         $25     
         43        ASSIGN                                                   !4, $25
   18    44      > JMP                                                      ->57
         45    >   INIT_FCALL                                               'stripos'
         46        SEND_VAR                                                 !2
         47        SEND_VAL                                                 'Concrete5_Model_'
         48        DO_ICALL                                                 
         49        INIT_FCALL                                               'stripos'
         50        SEND_VAR                                                 !2
         51        SEND_VAL                                                 'Concrete5_Helper_'
         52        DO_ICALL                                                 
         53        INIT_FCALL                                               'stripos'
         54        SEND_VAR                                                 !2
         55        SEND_VAL                                                 'Concrete5_Controller_Block_'
         56        DO_ICALL                                                 
         57    >   PRE_INC                                          ~30     !3
         58        IS_SMALLER                                               ~30, 1000000
         59      > JMPNZ                                                    ~31, ->45
   19    60    >   INIT_FCALL                                               'microtime'
         61        SEND_VAL                                                 <true>
         62        DO_ICALL                                         $32     
         63        ASSIGN                                                   !5, $32
   20    64        SUB                                              ~34     !5, !4
         65        CONCAT                                           ~35     'stripos%3A+', ~34
         66        ECHO                                                     ~35
         67      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.46 ms | 1392 KiB | 19 Q