3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = null; var_dump($foo ?? 'bar', $foo ?: 'bar', $foo ?? 'bar' ?: 'baz'); $foo = false; var_dump($foo ?? 'bar', $foo ?: 'bar', $foo ?? 'bar' ?: 'baz');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hZKBe
function name:  (null)
number of ops:  29
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, null
    4     1        INIT_FCALL                                               'var_dump'
          2        COALESCE                                         ~2      !0
          3        QM_ASSIGN                                        ~2      'bar'
          4        SEND_VAL                                                 ~2
          5        JMP_SET                                          ~3      !0, ->7
          6        QM_ASSIGN                                        ~3      'bar'
          7        SEND_VAL                                                 ~3
          8        COALESCE                                         ~4      !0
          9        QM_ASSIGN                                        ~4      'bar'
         10        JMP_SET                                          ~5      ~4, ->12
         11        QM_ASSIGN                                        ~5      'baz'
         12        SEND_VAL                                                 ~5
         13        DO_ICALL                                                 
    6    14        ASSIGN                                                   !0, <false>
    7    15        INIT_FCALL                                               'var_dump'
         16        COALESCE                                         ~8      !0
         17        QM_ASSIGN                                        ~8      'bar'
         18        SEND_VAL                                                 ~8
         19        JMP_SET                                          ~9      !0, ->21
         20        QM_ASSIGN                                        ~9      'bar'
         21        SEND_VAL                                                 ~9
         22        COALESCE                                         ~10     !0
         23        QM_ASSIGN                                        ~10     'bar'
         24        JMP_SET                                          ~11     ~10, ->26
         25        QM_ASSIGN                                        ~11     'baz'
         26        SEND_VAL                                                 ~11
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.36 ms | 1395 KiB | 15 Q