3v4l.org

run code in 300+ PHP versions simultaneously
<?php $path1 = 'C:\Winwdows\system32\drivers\etc'; $path2 = '/foo/bar/sub/home'; $t = microtime(); for ($i = 0; $i++; $i < 10000) { strtr($path1, '\\', '/'); strtr($path2, '\\', '/'); } var_dump(microtime() -$t); $t = microtime(); for ($i = 0; $i++; $i < 10000) { str_replace('\\', '/', $path1); str_replace('\\', '/', $path2); } var_dump(microtime() -$t);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 7
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 32
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 32
Branch analysis from position: 46
Branch analysis from position: 32
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 7
Branch analysis from position: 21
Branch analysis from position: 7
filename:       /in/blrd6
function name:  (null)
number of ops:  53
compiled vars:  !0 = $path1, !1 = $path2, !2 = $t, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'C%3A%5CWinwdows%5Csystem32%5Cdrivers%5Cetc'
    4     1        ASSIGN                                                   !1, '%2Ffoo%2Fbar%2Fsub%2Fhome'
    6     2        INIT_FCALL                                               'microtime'
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !2, $6
    8     5        ASSIGN                                                   !3, 0
          6      > JMP                                                      ->19
    9     7    >   INIT_FCALL                                               'strtr'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 '%5C'
         10        SEND_VAL                                                 '%2F'
         11        DO_ICALL                                                 
   10    12        INIT_FCALL                                               'strtr'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 '%5C'
         15        SEND_VAL                                                 '%2F'
         16        DO_ICALL                                                 
    8    17        IS_SMALLER                                       ~11     !3, 10000
         18        FREE                                                     ~11
         19    >   POST_INC                                         ~12     !3
         20      > JMPNZ                                                    ~12, ->7
   13    21    >   INIT_FCALL                                               'var_dump'
         22        INIT_FCALL                                               'microtime'
         23        DO_ICALL                                         $13     
         24        SUB                                              ~14     $13, !2
         25        SEND_VAL                                                 ~14
         26        DO_ICALL                                                 
   15    27        INIT_FCALL                                               'microtime'
         28        DO_ICALL                                         $16     
         29        ASSIGN                                                   !2, $16
   17    30        ASSIGN                                                   !3, 0
         31      > JMP                                                      ->44
   18    32    >   INIT_FCALL                                               'str_replace'
         33        SEND_VAL                                                 '%5C'
         34        SEND_VAL                                                 '%2F'
         35        SEND_VAR                                                 !0
         36        DO_ICALL                                                 
   19    37        INIT_FCALL                                               'str_replace'
         38        SEND_VAL                                                 '%5C'
         39        SEND_VAL                                                 '%2F'
         40        SEND_VAR                                                 !1
         41        DO_ICALL                                                 
   17    42        IS_SMALLER                                       ~21     !3, 10000
         43        FREE                                                     ~21
         44    >   POST_INC                                         ~22     !3
         45      > JMPNZ                                                    ~22, ->32
   22    46    >   INIT_FCALL                                               'var_dump'
         47        INIT_FCALL                                               'microtime'
         48        DO_ICALL                                         $23     
         49        SUB                                              ~24     $23, !2
         50        SEND_VAL                                                 ~24
         51        DO_ICALL                                                 
         52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.7 ms | 1400 KiB | 21 Q