3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = "12345"; $time_start = microtime(true); echo $var[0] . "-" . substr($var,1); $time_end = microtime(true); echo "\nExecution Time: " . $time_end - $time_start; $time_start = microtime(true); echo str_replace($var[0], $var[0].'-', $var); $time_end = microtime(true); echo "\nExecution Time: " . $time_end - $time_start;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rog1n
function name:  (null)
number of ops:  41
compiled vars:  !0 = $var, !1 = $time_start, !2 = $time_end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '12345'
    4     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
    5     5        FETCH_DIM_R                                      ~6      !0, 0
          6        CONCAT                                           ~7      ~6, '-'
          7        INIT_FCALL                                               'substr'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 1
         10        DO_ICALL                                         $8      
         11        CONCAT                                           ~9      ~7, $8
         12        ECHO                                                     ~9
    6    13        INIT_FCALL                                               'microtime'
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $10     
         16        ASSIGN                                                   !2, $10
    7    17        SUB                                              ~12     !2, !1
         18        CONCAT                                           ~13     '%0AExecution+Time%3A+', ~12
         19        ECHO                                                     ~13
    9    20        INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $14     
         23        ASSIGN                                                   !1, $14
   10    24        INIT_FCALL                                               'str_replace'
         25        FETCH_DIM_R                                      ~16     !0, 0
         26        SEND_VAL                                                 ~16
         27        FETCH_DIM_R                                      ~17     !0, 0
         28        CONCAT                                           ~18     ~17, '-'
         29        SEND_VAL                                                 ~18
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                         $19     
         32        ECHO                                                     $19
   11    33        INIT_FCALL                                               'microtime'
         34        SEND_VAL                                                 <true>
         35        DO_ICALL                                         $20     
         36        ASSIGN                                                   !2, $20
   12    37        SUB                                              ~22     !2, !1
         38        CONCAT                                           ~23     '%0AExecution+Time%3A+', ~22
         39        ECHO                                                     ~23
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.52 ms | 1396 KiB | 19 Q