3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Curious about the bytecode difference between comma-separated and period-concatenated echoes echo 'foo', 'bar', 'baz'; echo 'foo' . 'bar' . 'baz'; $bar = 'bar'; echo 'foo', $bar[rand(0,2)], 'baz'; echo 'foo' . $bar[rand(0,2)] . 'baz';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7GRcA
function name:  (null)
number of ops:  22
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'foo'
          1        ECHO                                                     'bar'
          2        ECHO                                                     'baz'
    6     3        ECHO                                                     'foobarbaz'
    7     4        ASSIGN                                                   !0, 'bar'
    8     5        ECHO                                                     'foo'
          6        INIT_FCALL                                               'rand'
          7        SEND_VAL                                                 0
          8        SEND_VAL                                                 2
          9        DO_ICALL                                         $2      
         10        FETCH_DIM_R                                      ~3      !0, $2
         11        ECHO                                                     ~3
         12        ECHO                                                     'baz'
    9    13        INIT_FCALL                                               'rand'
         14        SEND_VAL                                                 0
         15        SEND_VAL                                                 2
         16        DO_ICALL                                         $4      
         17        FETCH_DIM_R                                      ~5      !0, $4
         18        CONCAT                                           ~6      'foo', ~5
         19        CONCAT                                           ~7      ~6, 'baz'
         20        ECHO                                                     ~7
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.37 ms | 1395 KiB | 15 Q