3v4l.org

run code in 300+ PHP versions simultaneously
<?php $v1 = 5; $v2 = '5-4'; $class = 'Concrete5_Controller_Name'; // Let's warm up $i = 0; 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 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 5
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 15
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 61, Position 2 = 46
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 61, Position 2 = 46
Branch analysis from position: 61
Branch analysis from position: 46
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 15
Branch analysis from position: 30
Branch analysis from position: 15
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 6
Branch analysis from position: 6
Branch analysis from position: 6
filename:       /in/kng1m
function name:  (null)
number of ops:  69
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        ASSIGN                                                   !3, 0
    8     4      > JMP                                                      ->6
          5    > > JMPZ                                                     0, ->6
          6    >   PRE_INC                                          ~10     !3
          7        IS_SMALLER                                               ~10, 100000
          8      > JMPNZ                                                    ~11, ->5
   10     9    >   ASSIGN                                                   !3, 0
   11    10        INIT_FCALL                                               'microtime'
         11        SEND_VAL                                                 <true>
         12        DO_ICALL                                         $13     
         13        ASSIGN                                                   !4, $13
   12    14      > JMP                                                      ->27
         15    >   INIT_FCALL                                               'preg_match'
         16        SEND_VAL                                                 '%2F%5EConcrete5_Model_%28.%2A%29%2Fi'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19        INIT_FCALL                                               'preg_match'
         20        SEND_VAL                                                 '%2F%5EConcrete5_Helper_%28.%2A%29%2Fi'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
         23        INIT_FCALL                                               'preg_match'
         24        SEND_VAL                                                 '%2F%5EConcrete5_Controller_Block_%28.%2A%29%2Fi'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                                 
         27    >   PRE_INC                                          ~18     !3
         28        IS_SMALLER                                               ~18, 1000000
         29      > JMPNZ                                                    ~19, ->15
   13    30    >   INIT_FCALL                                               'microtime'
         31        SEND_VAL                                                 <true>
         32        DO_ICALL                                         $20     
         33        ASSIGN                                                   !5, $20
   14    34        SUB                                              ~22     !5, !4
         35        CONCAT                                           ~23     'preg_match%3A+', ~22
         36        CONCAT                                           ~24     ~23, '%0A'
         37        ECHO                                                     ~24
   15    38        UNSET_CV                                                 !4
         39        UNSET_CV                                                 !5
   17    40        ASSIGN                                                   !3, 0
   18    41        INIT_FCALL                                               'microtime'
         42        SEND_VAL                                                 <true>
         43        DO_ICALL                                         $26     
         44        ASSIGN                                                   !4, $26
   19    45      > JMP                                                      ->58
         46    >   INIT_FCALL                                               'stripos'
         47        SEND_VAR                                                 !2
         48        SEND_VAL                                                 'Concrete5_Model_'
         49        DO_ICALL                                                 
         50        INIT_FCALL                                               'stripos'
         51        SEND_VAR                                                 !2
         52        SEND_VAL                                                 'Concrete5_Helper_'
         53        DO_ICALL                                                 
         54        INIT_FCALL                                               'stripos'
         55        SEND_VAR                                                 !2
         56        SEND_VAL                                                 'Concrete5_Controller_Block_'
         57        DO_ICALL                                                 
         58    >   PRE_INC                                          ~31     !3
         59        IS_SMALLER                                               ~31, 1000000
         60      > JMPNZ                                                    ~32, ->46
   20    61    >   INIT_FCALL                                               'microtime'
         62        SEND_VAL                                                 <true>
         63        DO_ICALL                                         $33     
         64        ASSIGN                                                   !5, $33
   21    65        SUB                                              ~35     !5, !4
         66        CONCAT                                           ~36     'stripos%3A+', ~35
         67        ECHO                                                     ~36
         68      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.14 ms | 1400 KiB | 19 Q