3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.82 ms | 1396 KiB | 19 Q