3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = microtime(true); for ($i=0; $i<1e4; $i++) { $string = sprintf("%s%s$%s%s", $i, $i, '123', 'Test'); } $end = microtime(true); echo "Took: ", number_format(($end-$start)*1e3, 2), 'ms', PHP_EOL; $a = '123'; $b = 'Test'; $start = microtime(true); for ($i=0; $i<1e4; $i++) { $string = "$i$i$123$a$b"; } $end = microtime(true); echo "Took: ", number_format(($end-$start)*1e3, 2), 'ms', PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 6
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 39
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 39
Branch analysis from position: 48
Branch analysis from position: 39
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 6
Branch analysis from position: 17
Branch analysis from position: 6
filename:       /in/f17lt
function name:  (null)
number of ops:  63
compiled vars:  !0 = $start, !1 = $i, !2 = $string, !3 = $end, !4 = $a, !5 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $6      
          3        ASSIGN                                                   !0, $6
    4     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->15
    5     6    >   INIT_FCALL                                               'sprintf'
          7        SEND_VAL                                                 '%25s%25s%24%25s%25s'
          8        SEND_VAR                                                 !1
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 '123'
         11        SEND_VAL                                                 'Test'
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !2, $9
    4    14        PRE_INC                                                  !1
         15    >   IS_SMALLER                                               !1, 10000
         16      > JMPNZ                                                    ~12, ->6
    7    17    >   INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $13     
         20        ASSIGN                                                   !3, $13
    8    21        ECHO                                                     'Took%3A+'
         22        INIT_FCALL                                               'number_format'
         23        SUB                                              ~15     !3, !0
         24        MUL                                              ~16     ~15, 1000
         25        SEND_VAL                                                 ~16
         26        SEND_VAL                                                 2
         27        DO_ICALL                                         $17     
         28        ECHO                                                     $17
         29        ECHO                                                     'ms'
         30        ECHO                                                     '%0A'
   10    31        ASSIGN                                                   !4, '123'
   11    32        ASSIGN                                                   !5, 'Test'
   13    33        INIT_FCALL                                               'microtime'
         34        SEND_VAL                                                 <true>
         35        DO_ICALL                                         $20     
         36        ASSIGN                                                   !0, $20
   14    37        ASSIGN                                                   !1, 0
         38      > JMP                                                      ->46
   15    39    >   ROPE_INIT                                     5  ~24     !1
         40        ROPE_ADD                                      1  ~24     ~24, !1
         41        ROPE_ADD                                      2  ~24     ~24, '%24123'
         42        ROPE_ADD                                      3  ~24     ~24, !4
         43        ROPE_END                                      4  ~23     ~24, !5
         44        ASSIGN                                                   !2, ~23
   14    45        PRE_INC                                                  !1
         46    >   IS_SMALLER                                               !1, 10000
         47      > JMPNZ                                                    ~29, ->39
   17    48    >   INIT_FCALL                                               'microtime'
         49        SEND_VAL                                                 <true>
         50        DO_ICALL                                         $30     
         51        ASSIGN                                                   !3, $30
   18    52        ECHO                                                     'Took%3A+'
         53        INIT_FCALL                                               'number_format'
         54        SUB                                              ~32     !3, !0
         55        MUL                                              ~33     ~32, 1000
         56        SEND_VAL                                                 ~33
         57        SEND_VAL                                                 2
         58        DO_ICALL                                         $34     
         59        ECHO                                                     $34
         60        ECHO                                                     'ms'
         61        ECHO                                                     '%0A'
         62      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.32 ms | 1400 KiB | 19 Q