3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = NULL; echo 'foo ' . $foo ?? 'foo' . ' bar'; echo "\n"; echo 'correct: foo ' . ($foo ?? 'foo') . ' bar';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qaVSn
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, null
    4     1        CONCAT                                           ~2      'foo+', !0
          2        COALESCE                                         ~3      ~2
          3        QM_ASSIGN                                        ~3      'foo+bar'
          4        ECHO                                                     ~3
    5     5        ECHO                                                     '%0A'
    6     6        COALESCE                                         ~4      !0
          7        QM_ASSIGN                                        ~4      'foo'
          8        CONCAT                                           ~5      'correct%3A+foo+', ~4
          9        CONCAT                                           ~6      ~5, '+bar'
         10        ECHO                                                     ~6
         11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138 ms | 1432 KiB | 13 Q