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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.48 ms | 1404 KiB | 19 Q