3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.55 ms | 1400 KiB | 19 Q