3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = NULL; $y = NULL; $z = 3; $result = !empty($x) ? $x : (!empty($y) ? $y : (!empty($z) ? $z : 'empty')); echo $result . "\n"; $result2 = $x ?? $y ?? $z; echo $result2 . "\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/80XK5
function name:  (null)
number of ops:  32
compiled vars:  !0 = $x, !1 = $y, !2 = $z, !3 = $result, !4 = $result2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, null
    3     1        ASSIGN                                                   !1, null
    4     2        ASSIGN                                                   !2, 3
    6     3        ISSET_ISEMPTY_CV                                 ~8      !0
          4        BOOL_NOT                                         ~9      ~8
          5      > JMPZ                                                     ~9, ->8
          6    >   QM_ASSIGN                                        ~10     !0
          7      > JMP                                                      ->21
          8    >   ISSET_ISEMPTY_CV                                 ~11     !1
          9        BOOL_NOT                                         ~12     ~11
         10      > JMPZ                                                     ~12, ->13
         11    >   QM_ASSIGN                                        ~13     !1
         12      > JMP                                                      ->20
         13    >   ISSET_ISEMPTY_CV                                 ~14     !2
         14        BOOL_NOT                                         ~15     ~14
         15      > JMPZ                                                     ~15, ->18
         16    >   QM_ASSIGN                                        ~16     !2
         17      > JMP                                                      ->19
         18    >   QM_ASSIGN                                        ~16     'empty'
         19    >   QM_ASSIGN                                        ~13     ~16
         20    >   QM_ASSIGN                                        ~10     ~13
         21    >   ASSIGN                                                   !3, ~10
    8    22        CONCAT                                           ~18     !3, '%0A'
         23        ECHO                                                     ~18
   10    24        COALESCE                                         ~19     !0
         25        COALESCE                                         ~20     !1
         26        QM_ASSIGN                                        ~20     !2
         27        QM_ASSIGN                                        ~19     ~20
         28        ASSIGN                                                   !4, ~19
   12    29        CONCAT                                           ~22     !4, '%0A'
         30        ECHO                                                     ~22
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.99 ms | 1395 KiB | 13 Q