3v4l.org

run code in 300+ PHP versions simultaneously
<?php $iterations = 500000; $name = 'Tom'; $date = '13/09/2009'; $t1 = microtime(true); for ($i = 0; $i < $iterations; $i++) { $str = sprintf('Hi %s, you last logged in on %s.', $name, $date); } $t2 = microtime(true); echo 'sprintf: ' . ($t2-$t1); echo '<br />'; $t1 = microtime(true); for ($i = 0; $i < $iterations; $i++) { $str = 'Hi ' . $name . ', you last logged in on ' . $date; } $t2 = microtime(true); echo 'concat: ' . ($t2-$t1); echo '<br />';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 9
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 32
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 32
Branch analysis from position: 39
Branch analysis from position: 32
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 9
Branch analysis from position: 18
Branch analysis from position: 9
filename:       /in/b9cDs
function name:  (null)
number of ops:  48
compiled vars:  !0 = $iterations, !1 = $name, !2 = $date, !3 = $t1, !4 = $i, !5 = $str, !6 = $t2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 500000
    4     1        ASSIGN                                                   !1, 'Tom'
    5     2        ASSIGN                                                   !2, '13%2F09%2F2009'
    8     3        INIT_FCALL                                               'microtime'
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $10     
          6        ASSIGN                                                   !3, $10
    9     7        ASSIGN                                                   !4, 0
          8      > JMP                                                      ->16
   10     9    >   INIT_FCALL                                               'sprintf'
         10        SEND_VAL                                                 'Hi+%25s%2C+you+last+logged+in+on+%25s.'
         11        SEND_VAR                                                 !1
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $13     
         14        ASSIGN                                                   !5, $13
    9    15        PRE_INC                                                  !4
         16    >   IS_SMALLER                                               !4, !0
         17      > JMPNZ                                                    ~16, ->9
   12    18    >   INIT_FCALL                                               'microtime'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $17     
         21        ASSIGN                                                   !6, $17
   13    22        SUB                                              ~19     !6, !3
         23        CONCAT                                           ~20     'sprintf%3A+', ~19
         24        ECHO                                                     ~20
   15    25        ECHO                                                     '%3Cbr+%2F%3E'
   17    26        INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $21     
         29        ASSIGN                                                   !3, $21
   18    30        ASSIGN                                                   !4, 0
         31      > JMP                                                      ->37
   19    32    >   CONCAT                                           ~24     'Hi+', !1
         33        CONCAT                                           ~25     ~24, '%2C+you+last+logged+in+on+'
         34        CONCAT                                           ~26     ~25, !2
         35        ASSIGN                                                   !5, ~26
   18    36        PRE_INC                                                  !4
         37    >   IS_SMALLER                                               !4, !0
         38      > JMPNZ                                                    ~29, ->32
   21    39    >   INIT_FCALL                                               'microtime'
         40        SEND_VAL                                                 <true>
         41        DO_ICALL                                         $30     
         42        ASSIGN                                                   !6, $30
   22    43        SUB                                              ~32     !6, !3
         44        CONCAT                                           ~33     'concat%3A+', ~32
         45        ECHO                                                     ~33
   24    46        ECHO                                                     '%3Cbr+%2F%3E'
         47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.13 ms | 1400 KiB | 17 Q