3v4l.org

run code in 500+ 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 "\n"; $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 "\n"; $t1 = microtime(true); for ($i = 0; $i < $iterations; $i++) { $str = "Hi $name, you last logged in on $date"; } $t2 = microtime(true); echo 'expansion: ' . ($t2-$t1); echo "\n";
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 = 42) Position 1 = 59
Branch analysis from position: 59
2 jumps found. (Code = 44) Position 1 = 61, Position 2 = 53
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 53
2 jumps found. (Code = 44) Position 1 = 61, Position 2 = 53
Branch analysis from position: 61
Branch analysis from position: 53
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/sc4sl
function name:  (null)
number of ops:  70
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
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 500000
    5     1        ASSIGN                                                       !1, 'Tom'
    6     2        ASSIGN                                                       !2, '13%2F09%2F2009'
    9     3        INIT_FCALL                                                   'microtime'
          4        SEND_VAL                                                     <true>
          5        DO_ICALL                                             $10     
          6        ASSIGN                                                       !3, $10
   10     7        ASSIGN                                                       !4, 0
          8      > JMP                                                          ->16
   11     9    >   ROPE_INIT                                         5  ~14     'Hi+'
         10        ROPE_ADD                                          1  ~14     ~14, !1
         11        ROPE_ADD                                          2  ~14     ~14, '%2C+you+last+logged+in+on+'
         12        ROPE_ADD                                          3  ~14     ~14, !2
         13        ROPE_END                                          4  ~13     ~14, '.'
         14        ASSIGN                                                       !5, ~13
   10    15        PRE_INC                                                      !4
         16    >   IS_SMALLER                                                   !4, !0
         17      > JMPNZ                                                        ~19, ->9
   13    18    >   INIT_FCALL                                                   'microtime'
         19        SEND_VAL                                                     <true>
         20        DO_ICALL                                             $20     
         21        ASSIGN                                                       !6, $20
   14    22        SUB                                                  ~22     !6, !3
         23        CONCAT                                               ~23     'sprintf%3A+', ~22
         24        ECHO                                                         ~23
   16    25        ECHO                                                         '%0A'
   18    26        INIT_FCALL                                                   'microtime'
         27        SEND_VAL                                                     <true>
         28        DO_ICALL                                             $24     
         29        ASSIGN                                                       !3, $24
   19    30        ASSIGN                                                       !4, 0
         31      > JMP                                                          ->37
   20    32    >   CONCAT                                               ~27     'Hi+', !1
         33        CONCAT                                               ~28     ~27, '%2C+you+last+logged+in+on+'
         34        CONCAT                                               ~29     ~28, !2
         35        ASSIGN                                                       !5, ~29
   19    36        PRE_INC                                                      !4
         37    >   IS_SMALLER                                                   !4, !0
         38      > JMPNZ                                                        ~32, ->32
   22    39    >   INIT_FCALL                                                   'microtime'
         40        SEND_VAL                                                     <true>
         41        DO_ICALL                                             $33     
         42        ASSIGN                                                       !6, $33
   23    43        SUB                                                  ~35     !6, !3
         44        CONCAT                                               ~36     'concat%3A+', ~35
         45        ECHO                                                         ~36
   24    46        ECHO                                                         '%0A'
   26    47        INIT_FCALL                                                   'microtime'
         48        SEND_VAL                                                     <true>
         49        DO_ICALL                                             $37     
         50        ASSIGN                                                       !3, $37
   27    51        ASSIGN                                                       !4, 0
         52      > JMP                                                          ->59
   28    53    >   ROPE_INIT                                         4  ~41     'Hi+'
         54        ROPE_ADD                                          1  ~41     ~41, !1
         55        ROPE_ADD                                          2  ~41     ~41, '%2C+you+last+logged+in+on+'
         56        ROPE_END                                          3  ~40     ~41, !2
         57        ASSIGN                                                       !5, ~40
   27    58        PRE_INC                                                      !4
         59    >   IS_SMALLER                                                   !4, !0
         60      > JMPNZ                                                        ~45, ->53
   30    61    >   INIT_FCALL                                                   'microtime'
         62        SEND_VAL                                                     <true>
         63        DO_ICALL                                             $46     
         64        ASSIGN                                                       !6, $46
   31    65        SUB                                                  ~48     !6, !3
         66        CONCAT                                               ~49     'expansion%3A+', ~48
         67        ECHO                                                         ~49
   32    68        ECHO                                                         '%0A'
         69      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
184.4 ms | 1954 KiB | 14 Q