3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$host = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'; $host = 'unix://unixhost'; $start = microtime(true); for ($i=0; $i<=1000; $i++) { substr($host, 0, strlen('unix://')) !== 'unix://'; } echo (microtime(true) - $start) . PHP_EOL; $start = microtime(true); for ($i=0; $i<=1000; $i++) { strpos($host, 'unix://') !== 0; } echo (microtime(true) - $start) . PHP_EOL; $start = microtime(true); for ($i=0; $i<=1000; $i++) { preg_match('~^unix://~', $host); } echo (microtime(true) - $start) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 29
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
2 jumps found. (Code = 44) Position 1 = 57, Position 2 = 50
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 57, Position 2 = 50
Branch analysis from position: 57
Branch analysis from position: 50
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 29
Branch analysis from position: 38
Branch analysis from position: 29
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
Branch analysis from position: 7
filename:       /in/rv7pl
function name:  (null)
number of ops:  64
compiled vars:  !0 = $host, !1 = $start, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'unix%3A%2F%2Funixhost'
    6     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
    8     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->15
    9     7    >   INIT_FCALL                                               'substr'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 0
         10        SEND_VAL                                                 7
         11        DO_ICALL                                         $7      
         12        IS_NOT_IDENTICAL                                 ~8      $7, 'unix%3A%2F%2F'
         13        FREE                                                     ~8
    8    14        PRE_INC                                                  !2
         15    >   IS_SMALLER_OR_EQUAL                                      !2, 1000
         16      > JMPNZ                                                    ~10, ->7
   11    17    >   INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $11     
         20        SUB                                              ~12     $11, !1
         21        CONCAT                                           ~13     ~12, '%0A'
         22        ECHO                                                     ~13
   14    23        INIT_FCALL                                               'microtime'
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $14     
         26        ASSIGN                                                   !1, $14
   16    27        ASSIGN                                                   !2, 0
         28      > JMP                                                      ->36
   17    29    >   INIT_FCALL                                               'strpos'
         30        SEND_VAR                                                 !0
         31        SEND_VAL                                                 'unix%3A%2F%2F'
         32        DO_ICALL                                         $17     
         33        IS_NOT_IDENTICAL                                 ~18     $17, 0
         34        FREE                                                     ~18
   16    35        PRE_INC                                                  !2
         36    >   IS_SMALLER_OR_EQUAL                                      !2, 1000
         37      > JMPNZ                                                    ~20, ->29
   19    38    >   INIT_FCALL                                               'microtime'
         39        SEND_VAL                                                 <true>
         40        DO_ICALL                                         $21     
         41        SUB                                              ~22     $21, !1
         42        CONCAT                                           ~23     ~22, '%0A'
         43        ECHO                                                     ~23
   22    44        INIT_FCALL                                               'microtime'
         45        SEND_VAL                                                 <true>
         46        DO_ICALL                                         $24     
         47        ASSIGN                                                   !1, $24
   24    48        ASSIGN                                                   !2, 0
         49      > JMP                                                      ->55
   25    50    >   INIT_FCALL                                               'preg_match'
         51        SEND_VAL                                                 '%7E%5Eunix%3A%2F%2F%7E'
         52        SEND_VAR                                                 !0
         53        DO_ICALL                                                 
   24    54        PRE_INC                                                  !2
         55    >   IS_SMALLER_OR_EQUAL                                      !2, 1000
         56      > JMPNZ                                                    ~29, ->50
   27    57    >   INIT_FCALL                                               'microtime'
         58        SEND_VAL                                                 <true>
         59        DO_ICALL                                         $30     
         60        SUB                                              ~31     $30, !1
         61        CONCAT                                           ~32     ~31, '%0A'
         62        ECHO                                                     ~32
   28    63      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.22 ms | 1013 KiB | 17 Q