3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.82 ms | 1404 KiB | 19 Q