3v4l.org

run code in 300+ PHP versions simultaneously
<?php function NC($x){ return ($x ?? "Foo"); } NC(NULL); // I know this will return "Foo". /* But I have no clue about what these will return. */ NC(0); NC(-1); NC(""); NC(array());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/anlvn
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'nc'
          1        SEND_VAL                                                 null
          2        DO_FCALL                                      0          
    9     3        INIT_FCALL                                               'nc'
          4        SEND_VAL                                                 0
          5        DO_FCALL                                      0          
   10     6        INIT_FCALL                                               'nc'
          7        SEND_VAL                                                 -1
          8        DO_FCALL                                      0          
   11     9        INIT_FCALL                                               'nc'
         10        SEND_VAL                                                 ''
         11        DO_FCALL                                      0          
   12    12        INIT_FCALL                                               'nc'
         13        SEND_VAL                                                 <array>
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Function nc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/anlvn
function name:  NC
number of ops:  5
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        COALESCE                                         ~1      !0
          2        QM_ASSIGN                                        ~1      'Foo'
          3      > RETURN                                                   ~1
    5     4*     > RETURN                                                   null

End of function nc

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.18 ms | 1397 KiB | 18 Q