3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = microtime(true); for ($i = 0; $i < 10000; $i++) { preg_match('/^label-(.+)/', 'label-en_US', $matches); } $time = microtime(true) - $time; echo 'preg_match() took ' . number_format($time, 3) . ' seconds' . "\n"; $time = microtime(true); for ($i = 0; $i < 10000; $i++) { explode('-', 'label-en_US'); } $time = microtime(true) - $time; echo 'explode() took ' . number_format($time, 3) . ' seconds' . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 33
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 33
Branch analysis from position: 40
Branch analysis from position: 33
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
Branch analysis from position: 6
filename:       /in/gqEjY
function name:  (null)
number of ops:  54
compiled vars:  !0 = $time, !1 = $i, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
    4     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->12
    5     6    >   INIT_FCALL                                               'preg_match'
          7        SEND_VAL                                                 '%2F%5Elabel-%28.%2B%29%2F'
          8        SEND_VAL                                                 'label-en_US'
          9        SEND_REF                                                 !2
         10        DO_ICALL                                                 
    4    11        PRE_INC                                                  !1
         12    >   IS_SMALLER                                               !1, 10000
         13      > JMPNZ                                                    ~8, ->6
    8    14    >   INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $9      
         17        SUB                                              ~10     $9, !0
         18        ASSIGN                                                   !0, ~10
   10    19        INIT_FCALL                                               'number_format'
         20        SEND_VAR                                                 !0
         21        SEND_VAL                                                 3
         22        DO_ICALL                                         $12     
         23        CONCAT                                           ~13     'preg_match%28%29+took+', $12
         24        CONCAT                                           ~14     ~13, '+seconds'
         25        CONCAT                                           ~15     ~14, '%0A'
         26        ECHO                                                     ~15
   12    27        INIT_FCALL                                               'microtime'
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $16     
         30        ASSIGN                                                   !0, $16
   13    31        ASSIGN                                                   !1, 0
         32      > JMP                                                      ->38
   14    33    >   INIT_FCALL                                               'explode'
         34        SEND_VAL                                                 '-'
         35        SEND_VAL                                                 'label-en_US'
         36        DO_ICALL                                                 
   13    37        PRE_INC                                                  !1
         38    >   IS_SMALLER                                               !1, 10000
         39      > JMPNZ                                                    ~21, ->33
   17    40    >   INIT_FCALL                                               'microtime'
         41        SEND_VAL                                                 <true>
         42        DO_ICALL                                         $22     
         43        SUB                                              ~23     $22, !0
         44        ASSIGN                                                   !0, ~23
   18    45        INIT_FCALL                                               'number_format'
         46        SEND_VAR                                                 !0
         47        SEND_VAL                                                 3
         48        DO_ICALL                                         $25     
         49        CONCAT                                           ~26     'explode%28%29+took+', $25
         50        CONCAT                                           ~27     ~26, '+seconds'
         51        CONCAT                                           ~28     ~27, '%0A'
         52        ECHO                                                     ~28
         53      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.87 ms | 1400 KiB | 21 Q