3v4l.org

run code in 300+ PHP versions simultaneously
<?php $class = 'Concrete5_Controller_Name'; // Let's warm up while(++$i < 1000000) { if(0) {} } // Test 'else if' $i = 0; $start = microtime(true); while(++$i < 10000000) { preg_match('/^Concrete5_Model_(.*)/i', $class); } $end = microtime(true); echo "preg_match: ".($end - $start)."\n"; unset($start, $end); // Test 'elseif' $i = 0; $start = microtime(true); while(++$i < 10000000) { stripos($class, 'Concrete5_Model_'); } $end = microtime(true); echo "stripos: ".($end - $start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 2
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 12
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 35
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 35
Branch analysis from position: 42
Branch analysis from position: 35
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 12
Branch analysis from position: 19
Branch analysis from position: 12
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 3
Branch analysis from position: 3
Branch analysis from position: 3
filename:       /in/9hlaq
function name:  (null)
number of ops:  50
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      > JMP                                                      ->3
          2    > > JMPZ                                                     0, ->3
          3    >   PRE_INC                                          ~5      !1
          4        IS_SMALLER                                               ~5, 1000000
          5      > JMPNZ                                                    ~6, ->2
    6     6    >   ASSIGN                                                   !1, 0
    7     7        INIT_FCALL                                               'microtime'
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !2, $8
    8    11      > JMP                                                      ->16
         12    >   INIT_FCALL                                               'preg_match'
         13        SEND_VAL                                                 '%2F%5EConcrete5_Model_%28.%2A%29%2Fi'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
         16    >   PRE_INC                                          ~11     !1
         17        IS_SMALLER                                               ~11, 10000000
         18      > JMPNZ                                                    ~12, ->12
    9    19    >   INIT_FCALL                                               'microtime'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $13     
         22        ASSIGN                                                   !3, $13
   10    23        SUB                                              ~15     !3, !2
         24        CONCAT                                           ~16     'preg_match%3A+', ~15
         25        CONCAT                                           ~17     ~16, '%0A'
         26        ECHO                                                     ~17
   11    27        UNSET_CV                                                 !2
         28        UNSET_CV                                                 !3
   13    29        ASSIGN                                                   !1, 0
   14    30        INIT_FCALL                                               'microtime'
         31        SEND_VAL                                                 <true>
         32        DO_ICALL                                         $19     
         33        ASSIGN                                                   !2, $19
   15    34      > JMP                                                      ->39
         35    >   INIT_FCALL                                               'stripos'
         36        SEND_VAR                                                 !0
         37        SEND_VAL                                                 'Concrete5_Model_'
         38        DO_ICALL                                                 
         39    >   PRE_INC                                          ~22     !1
         40        IS_SMALLER                                               ~22, 10000000
         41      > JMPNZ                                                    ~23, ->35
   16    42    >   INIT_FCALL                                               'microtime'
         43        SEND_VAL                                                 <true>
         44        DO_ICALL                                         $24     
         45        ASSIGN                                                   !3, $24
   17    46        SUB                                              ~26     !3, !2
         47        CONCAT                                           ~27     'stripos%3A+', ~26
         48        ECHO                                                     ~27
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.4 ms | 1400 KiB | 19 Q