3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startTimeOne = microtime(true); for ($i = 0; $i <= 10000; $i++) { str_replace('-', '+', 'my-name-is-am-and-i-like-trains'); } $endTimeOne = microtime(true); for ($j = 0; $j <= 10000; $j++) { str_replace('-', '+', 'foo-bar'); } $endTimeTwo = microtime(true); for ($j = 0; $j <= 10000; $j++) { preg_replace('#-#', '+', 'my-name-is-am-and-i-like-trains'); } $endTimeThree = microtime(true); for ($j = 0; $j <= 10000; $j++) { preg_replace('#-#', '+', 'foo-bar'); } $endTimeFour = microtime(true); echo ($endTimeOne - $startTimeOne) * 1000 . "\n"; echo ($endTimeTwo - $endTimeOne) * 1000 . "\n"; echo ($endTimeThree - $endTimeTwo) * 1000 . "\n"; echo ($endTimeFour - $endTimeThree) * 1000;
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 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 20
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 34
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 48
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 48
Branch analysis from position: 56
Branch analysis from position: 48
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 34
Branch analysis from position: 42
Branch analysis from position: 34
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 20
Branch analysis from position: 28
Branch analysis from position: 20
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/AUfut
function name:  (null)
number of ops:  76
compiled vars:  !0 = $startTimeOne, !1 = $i, !2 = $endTimeOne, !3 = $j, !4 = $endTimeTwo, !5 = $endTimeThree, !6 = $endTimeFour
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $7      
          3        ASSIGN                                                   !0, $7
    5     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->12
    6     6    >   INIT_FCALL                                               'str_replace'
          7        SEND_VAL                                                 '-'
          8        SEND_VAL                                                 '%2B'
          9        SEND_VAL                                                 'my-name-is-am-and-i-like-trains'
         10        DO_ICALL                                                 
    5    11        PRE_INC                                                  !1
         12    >   IS_SMALLER_OR_EQUAL                                      !1, 10000
         13      > JMPNZ                                                    ~12, ->6
    9    14    >   INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $13     
         17        ASSIGN                                                   !2, $13
   11    18        ASSIGN                                                   !3, 0
         19      > JMP                                                      ->26
   12    20    >   INIT_FCALL                                               'str_replace'
         21        SEND_VAL                                                 '-'
         22        SEND_VAL                                                 '%2B'
         23        SEND_VAL                                                 'foo-bar'
         24        DO_ICALL                                                 
   11    25        PRE_INC                                                  !3
         26    >   IS_SMALLER_OR_EQUAL                                      !3, 10000
         27      > JMPNZ                                                    ~18, ->20
   15    28    >   INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $19     
         31        ASSIGN                                                   !4, $19
   17    32        ASSIGN                                                   !3, 0
         33      > JMP                                                      ->40
   18    34    >   INIT_FCALL                                               'preg_replace'
         35        SEND_VAL                                                 '%23-%23'
         36        SEND_VAL                                                 '%2B'
         37        SEND_VAL                                                 'my-name-is-am-and-i-like-trains'
         38        DO_ICALL                                                 
   17    39        PRE_INC                                                  !3
         40    >   IS_SMALLER_OR_EQUAL                                      !3, 10000
         41      > JMPNZ                                                    ~24, ->34
   21    42    >   INIT_FCALL                                               'microtime'
         43        SEND_VAL                                                 <true>
         44        DO_ICALL                                         $25     
         45        ASSIGN                                                   !5, $25
   23    46        ASSIGN                                                   !3, 0
         47      > JMP                                                      ->54
   24    48    >   INIT_FCALL                                               'preg_replace'
         49        SEND_VAL                                                 '%23-%23'
         50        SEND_VAL                                                 '%2B'
         51        SEND_VAL                                                 'foo-bar'
         52        DO_ICALL                                                 
   23    53        PRE_INC                                                  !3
         54    >   IS_SMALLER_OR_EQUAL                                      !3, 10000
         55      > JMPNZ                                                    ~30, ->48
   27    56    >   INIT_FCALL                                               'microtime'
         57        SEND_VAL                                                 <true>
         58        DO_ICALL                                         $31     
         59        ASSIGN                                                   !6, $31
   30    60        SUB                                              ~33     !2, !0
         61        MUL                                              ~34     ~33, 1000
         62        CONCAT                                           ~35     ~34, '%0A'
         63        ECHO                                                     ~35
   31    64        SUB                                              ~36     !4, !2
         65        MUL                                              ~37     ~36, 1000
         66        CONCAT                                           ~38     ~37, '%0A'
         67        ECHO                                                     ~38
   32    68        SUB                                              ~39     !5, !4
         69        MUL                                              ~40     ~39, 1000
         70        CONCAT                                           ~41     ~40, '%0A'
         71        ECHO                                                     ~41
   33    72        SUB                                              ~42     !6, !5
         73        MUL                                              ~43     ~42, 1000
         74        ECHO                                                     ~43
         75      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.97 ms | 1452 KiB | 16 Q