3v4l.org

run code in 300+ PHP versions simultaneously
<?php $vars['x'] = 10; $vars['y'] = 100; $vars['a'] = '1'; $vars['b'] = 1.1; $iterations = 100000; $start = microtime(true); for ($i = 0; $i<$iterations; $i++) { $foo = sprintf('from %s to %s %s %s', $vars['x'], $vars['y'], $vars['a'], $vars['b']); } var_dump(microtime(true) - $start); $start = microtime(true); for ($i = 0; $i<$iterations; $i++) { $foo = 'from ' . $vars['x'] . ' to ' . $vars['y'] . ' ' . $vars['a'] . ' '. $vars['b']; } var_dump(microtime(true) - $start); $start = microtime(true); for ($i = 0; $i<$iterations; $i++) { $foo = "from {$vars['x']} to {$vars['y']} {$vars['a']} {$vars['b']}"; } var_dump(microtime(true) - $start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 15
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 43
Branch analysis from position: 58
1 jumps found. (Code = 42) Position 1 = 85
Branch analysis from position: 85
2 jumps found. (Code = 44) Position 1 = 87, Position 2 = 71
Branch analysis from position: 87
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 71
2 jumps found. (Code = 44) Position 1 = 87, Position 2 = 71
Branch analysis from position: 87
Branch analysis from position: 71
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 43
Branch analysis from position: 58
Branch analysis from position: 43
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 15
Branch analysis from position: 30
Branch analysis from position: 15
filename:       /in/uQ8kY
function name:  (null)
number of ops:  95
compiled vars:  !0 = $vars, !1 = $iterations, !2 = $start, !3 = $i, !4 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN_DIM                                               !0, 'x'
          1        OP_DATA                                                  10
    3     2        ASSIGN_DIM                                               !0, 'y'
          3        OP_DATA                                                  100
    4     4        ASSIGN_DIM                                               !0, 'a'
          5        OP_DATA                                                  '1'
    5     6        ASSIGN_DIM                                               !0, 'b'
          7        OP_DATA                                                  1.1
    6     8        ASSIGN                                                   !1, 100000
    7     9        INIT_FCALL                                               'microtime'
         10        SEND_VAL                                                 <true>
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !2, $10
    8    13        ASSIGN                                                   !3, 0
         14      > JMP                                                      ->28
    9    15    >   INIT_FCALL                                               'sprintf'
         16        SEND_VAL                                                 'from+%25s+to+%25s+%25s+%25s'
         17        FETCH_DIM_R                                      ~13     !0, 'x'
         18        SEND_VAL                                                 ~13
         19        FETCH_DIM_R                                      ~14     !0, 'y'
         20        SEND_VAL                                                 ~14
         21        FETCH_DIM_R                                      ~15     !0, 'a'
         22        SEND_VAL                                                 ~15
         23        FETCH_DIM_R                                      ~16     !0, 'b'
         24        SEND_VAL                                                 ~16
         25        DO_ICALL                                         $17     
         26        ASSIGN                                                   !4, $17
    8    27        PRE_INC                                                  !3
         28    >   IS_SMALLER                                               !3, !1
         29      > JMPNZ                                                    ~20, ->15
   11    30    >   INIT_FCALL                                               'var_dump'
         31        INIT_FCALL                                               'microtime'
         32        SEND_VAL                                                 <true>
         33        DO_ICALL                                         $21     
         34        SUB                                              ~22     $21, !2
         35        SEND_VAL                                                 ~22
         36        DO_ICALL                                                 
   14    37        INIT_FCALL                                               'microtime'
         38        SEND_VAL                                                 <true>
         39        DO_ICALL                                         $24     
         40        ASSIGN                                                   !2, $24
   15    41        ASSIGN                                                   !3, 0
         42      > JMP                                                      ->56
   16    43    >   FETCH_DIM_R                                      ~27     !0, 'x'
         44        CONCAT                                           ~28     'from+', ~27
         45        CONCAT                                           ~29     ~28, '+to+'
         46        FETCH_DIM_R                                      ~30     !0, 'y'
         47        CONCAT                                           ~31     ~29, ~30
         48        CONCAT                                           ~32     ~31, '+'
         49        FETCH_DIM_R                                      ~33     !0, 'a'
         50        CONCAT                                           ~34     ~32, ~33
         51        CONCAT                                           ~35     ~34, '+'
         52        FETCH_DIM_R                                      ~36     !0, 'b'
         53        CONCAT                                           ~37     ~35, ~36
         54        ASSIGN                                                   !4, ~37
   15    55        PRE_INC                                                  !3
         56    >   IS_SMALLER                                               !3, !1
         57      > JMPNZ                                                    ~40, ->43
   18    58    >   INIT_FCALL                                               'var_dump'
         59        INIT_FCALL                                               'microtime'
         60        SEND_VAL                                                 <true>
         61        DO_ICALL                                         $41     
         62        SUB                                              ~42     $41, !2
         63        SEND_VAL                                                 ~42
         64        DO_ICALL                                                 
   21    65        INIT_FCALL                                               'microtime'
         66        SEND_VAL                                                 <true>
         67        DO_ICALL                                         $44     
         68        ASSIGN                                                   !2, $44
   22    69        ASSIGN                                                   !3, 0
         70      > JMP                                                      ->85
   23    71    >   ROPE_INIT                                     8  ~52     'from+'
         72        FETCH_DIM_R                                      ~47     !0, 'x'
         73        ROPE_ADD                                      1  ~52     ~52, ~47
         74        ROPE_ADD                                      2  ~52     ~52, '+to+'
         75        FETCH_DIM_R                                      ~48     !0, 'y'
         76        ROPE_ADD                                      3  ~52     ~52, ~48
         77        ROPE_ADD                                      4  ~52     ~52, '+'
         78        FETCH_DIM_R                                      ~49     !0, 'a'
         79        ROPE_ADD                                      5  ~52     ~52, ~49
         80        ROPE_ADD                                      6  ~52     ~52, '+'
         81        FETCH_DIM_R                                      ~50     !0, 'b'
         82        ROPE_END                                      7  ~51     ~52, ~50
         83        ASSIGN                                                   !4, ~51
   22    84        PRE_INC                                                  !3
         85    >   IS_SMALLER                                               !3, !1
         86      > JMPNZ                                                    ~58, ->71
   25    87    >   INIT_FCALL                                               'var_dump'
         88        INIT_FCALL                                               'microtime'
         89        SEND_VAL                                                 <true>
         90        DO_ICALL                                         $59     
         91        SUB                                              ~60     $59, !2
         92        SEND_VAL                                                 ~60
         93        DO_ICALL                                                 
         94      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.22 ms | 1404 KiB | 19 Q