3v4l.org

run code in 300+ PHP versions simultaneously
<?php function NC($x){ $y = array(); $y['test'] = $x; $returnThis = $y['test'] ?? "Foo"; return $returnThis; } var_dump(NC(NULL)); // I know this will return "Foo". /* But I have no clue about what these will return. */ var_dump(NC(0)); var_dump(NC(-1)); var_dump(NC("")); var_dump(NC(array()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZS3uB
function name:  (null)
number of ops:  31
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'nc'
          2        SEND_VAL                                                 null
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   12     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'nc'
          8        SEND_VAL                                                 0
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
   13    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'nc'
         14        SEND_VAL                                                 -1
         15        DO_FCALL                                      0  $4      
         16        SEND_VAR                                                 $4
         17        DO_ICALL                                                 
   14    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'nc'
         20        SEND_VAL                                                 ''
         21        DO_FCALL                                      0  $6      
         22        SEND_VAR                                                 $6
         23        DO_ICALL                                                 
   15    24        INIT_FCALL                                               'var_dump'
         25        INIT_FCALL                                               'nc'
         26        SEND_VAL                                                 <array>
         27        DO_FCALL                                      0  $8      
         28        SEND_VAR                                                 $8
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Function nc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZS3uB
function name:  NC
number of ops:  10
compiled vars:  !0 = $x, !1 = $y, !2 = $returnThis
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN_DIM                                               !1, 'test'
          3        OP_DATA                                                  !0
    6     4        FETCH_DIM_IS                                     ~5      !1, 'test'
          5        COALESCE                                         ~6      ~5
          6        QM_ASSIGN                                        ~6      'Foo'
          7        ASSIGN                                                   !2, ~6
    7     8      > RETURN                                                   !2
    8     9*     > RETURN                                                   null

End of function nc

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.71 ms | 1402 KiB | 20 Q