3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = microtime(true); for ($i = 0; $i < 1000000; $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 < 1000000; $i++) { strpos('label', 'label-en_US'); 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 = 42
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 33
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 33
Branch analysis from position: 44
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/uNrWD
function name:  (null)
number of ops:  58
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, 1000000
         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                                                      ->42
   14    33    >   INIT_FCALL                                               'strpos'
         34        SEND_VAL                                                 'label'
         35        SEND_VAL                                                 'label-en_US'
         36        DO_ICALL                                                 
   15    37        INIT_FCALL                                               'explode'
         38        SEND_VAL                                                 '-'
         39        SEND_VAL                                                 'label-en_US'
         40        DO_ICALL                                                 
   13    41        PRE_INC                                                  !1
         42    >   IS_SMALLER                                               !1, 1000000
         43      > JMPNZ                                                    ~22, ->33
   18    44    >   INIT_FCALL                                               'microtime'
         45        SEND_VAL                                                 <true>
         46        DO_ICALL                                         $23     
         47        SUB                                              ~24     $23, !0
         48        ASSIGN                                                   !0, ~24
   19    49        INIT_FCALL                                               'number_format'
         50        SEND_VAR                                                 !0
         51        SEND_VAL                                                 3
         52        DO_ICALL                                         $26     
         53        CONCAT                                           ~27     'explode%28%29+took+', $26
         54        CONCAT                                           ~28     ~27, '+seconds'
         55        CONCAT                                           ~29     ~28, '%0A'
         56        ECHO                                                     ~29
         57      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.59 ms | 1392 KiB | 23 Q