Hello all,

I am writing to see if anyone is interested in an RFC for ability to 
automatically coalesce nullable method parameters with the supplied default. It 
would look something like this:

function foo(?array $bar ??= []) {

This would result in $bar automatically converting to an array if null is 
passed, as opposed to either having to do a null check before the function call 
and not passing parameter at all - or alternatively having to do something like:

function foo(?array $bar = []) {
    $bar ??= [];


I don’t see this creating any BC incompatibilites and the ??= syntax is 
something already in use in PHP since 7~

I don’t have any experience with C, so would ideally love it someone could help 
with the development with this, or maybe point me in the right direction.

I would also require RFC Karma if people are interested in opening a discussion 
about this (dansimkus)

Thank you all for your time

Regards,
Daniel Simkus

Reply via email to