3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = isset($b) ? $b : -1; $a = $b ?? -1; echo $a; // results: -1 $a = null; $b = null; $c = 10; $d = null; var_dump ($a ?? $b ?? $c ?? $d); // results: 10
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OldcW
function name:  (null)
number of ops:  24
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ISSET_ISEMPTY_CV                                         !1
          1      > JMPZ                                                     ~4, ->4
          2    >   QM_ASSIGN                                        ~5      !1
          3      > JMP                                                      ->5
          4    >   QM_ASSIGN                                        ~5      -1
          5    >   ASSIGN                                                   !0, ~5
    3     6        COALESCE                                         ~7      !1
          7        QM_ASSIGN                                        ~7      -1
          8        ASSIGN                                                   !0, ~7
    5     9        ECHO                                                     !0
    7    10        ASSIGN                                                   !0, null
    8    11        ASSIGN                                                   !1, null
    9    12        ASSIGN                                                   !2, 10
   10    13        ASSIGN                                                   !3, null
   12    14        INIT_FCALL                                               'var_dump'
         15        COALESCE                                         ~13     !0
         16        COALESCE                                         ~14     !1
         17        COALESCE                                         ~15     !2
         18        QM_ASSIGN                                        ~15     !3
         19        QM_ASSIGN                                        ~14     ~15
         20        QM_ASSIGN                                        ~13     ~14
         21        SEND_VAL                                                 ~13
         22        DO_ICALL                                                 
   13    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
201.65 ms | 1395 KiB | 15 Q