3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = 'React/Controller/Website/User'; $s = microtime(true); for ($i = 0; $i < 1000; $i++) $result = strtr($var, '/', '_'); printf('%.09f', microtime(true) - $s); var_dump($result); echo "\n"; $s = microtime(true); for ($i = 0; $i < 1000; $i++) $result = str_replace('/', '_', $var); printf('%.09f', microtime(true) - $s); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 7
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 34
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 34
Branch analysis from position: 43
Branch analysis from position: 34
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 7
Branch analysis from position: 16
Branch analysis from position: 7
filename:       /in/9L0lT
function name:  (null)
number of ops:  55
compiled vars:  !0 = $var, !1 = $s, !2 = $i, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'React%2FController%2FWebsite%2FUser'
    3     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    4     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->14
    5     7    >   INIT_FCALL                                               'strtr'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 '%2F'
         10        SEND_VAL                                                 '_'
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !3, $8
    4    13        PRE_INC                                                  !2
         14    >   IS_SMALLER                                               !2, 1000
         15      > JMPNZ                                                    ~11, ->7
    6    16    >   INIT_FCALL                                               'printf'
         17        SEND_VAL                                                 '%25.09f'
         18        INIT_FCALL                                               'microtime'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $12     
         21        SUB                                              ~13     $12, !1
         22        SEND_VAL                                                 ~13
         23        DO_ICALL                                                 
    8    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !3
         26        DO_ICALL                                                 
    9    27        ECHO                                                     '%0A'
   11    28        INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $16     
         31        ASSIGN                                                   !1, $16
   12    32        ASSIGN                                                   !2, 0
         33      > JMP                                                      ->41
   13    34    >   INIT_FCALL                                               'str_replace'
         35        SEND_VAL                                                 '%2F'
         36        SEND_VAL                                                 '_'
         37        SEND_VAR                                                 !0
         38        DO_ICALL                                         $19     
         39        ASSIGN                                                   !3, $19
   12    40        PRE_INC                                                  !2
         41    >   IS_SMALLER                                               !2, 1000
         42      > JMPNZ                                                    ~22, ->34
   14    43    >   INIT_FCALL                                               'printf'
         44        SEND_VAL                                                 '%25.09f'
         45        INIT_FCALL                                               'microtime'
         46        SEND_VAL                                                 <true>
         47        DO_ICALL                                         $23     
         48        SUB                                              ~24     $23, !1
         49        SEND_VAL                                                 ~24
         50        DO_ICALL                                                 
   15    51        INIT_FCALL                                               'var_dump'
         52        SEND_VAR                                                 !3
         53        DO_ICALL                                                 
         54      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.34 ms | 1400 KiB | 23 Q