3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.26 ms | 1400 KiB | 19 Q