3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = null; print $a ?? 'b'; print "\n"; print $a ?: 'b'; print "\n"; print $c ?? 'a'; print "\n"; print $c ?: 'a'; print "\n"; $b = array('a' => null); print $b['a'] ?? 'd'; print "\n"; print $b['a'] ?: 'd'; print "\n"; print $b['c'] ?? 'e'; print "\n"; print $b['c'] ?: 'e'; print "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/McavC
function name:  (null)
number of ops:  39
compiled vars:  !0 = $a, !1 = $c, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, null
    5     1        COALESCE                                         ~4      !0
          2        QM_ASSIGN                                        ~4      'b'
          3        ECHO                                                     ~4
    6     4        ECHO                                                     '%0A'
    8     5        JMP_SET                                          ~5      !0, ->7
          6        QM_ASSIGN                                        ~5      'b'
          7        ECHO                                                     ~5
    9     8        ECHO                                                     '%0A'
   11     9        COALESCE                                         ~6      !1
         10        QM_ASSIGN                                        ~6      'a'
         11        ECHO                                                     ~6
   12    12        ECHO                                                     '%0A'
   14    13        JMP_SET                                          ~7      !1, ->15
         14        QM_ASSIGN                                        ~7      'a'
         15        ECHO                                                     ~7
   15    16        ECHO                                                     '%0A'
   17    17        ASSIGN                                                   !2, <array>
   19    18        FETCH_DIM_IS                                     ~9      !2, 'a'
         19        COALESCE                                         ~10     ~9
         20        QM_ASSIGN                                        ~10     'd'
         21        ECHO                                                     ~10
   20    22        ECHO                                                     '%0A'
   22    23        FETCH_DIM_R                                      ~11     !2, 'a'
         24        JMP_SET                                          ~12     ~11, ->26
         25        QM_ASSIGN                                        ~12     'd'
         26        ECHO                                                     ~12
   23    27        ECHO                                                     '%0A'
   25    28        FETCH_DIM_IS                                     ~13     !2, 'c'
         29        COALESCE                                         ~14     ~13
         30        QM_ASSIGN                                        ~14     'e'
         31        ECHO                                                     ~14
   26    32        ECHO                                                     '%0A'
   28    33        FETCH_DIM_R                                      ~15     !2, 'c'
         34        JMP_SET                                          ~16     ~15, ->36
         35        QM_ASSIGN                                        ~16     'e'
         36        ECHO                                                     ~16
   29    37        ECHO                                                     '%0A'
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.94 ms | 1443 KiB | 13 Q