Re: [RFC] Default expression
| From: | Bilge | Date: | Sat, 24 Aug 2024 21:35:57 +0000 |
| Subject: | Re: [RFC] Default expression | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-125195@lists.php.net to get a copy of this message | ||
On 24/08/2024 22:14, Rob Landers wrote:
On Sat, Aug 24, 2024, at 18:49, Bilge wrote:Cheers, Bilgeas soon as two or more nullable arguments are involvedI'm not sure what you mean here. I use this method all the time :) much to the chagrin of some of my coworkers. function stuff($foo = 'bar', $baz = 'world'); stuff(...[ ...($foo ? ['foo' => $foo] : []), ...($baz ? ['baz' => $baz] : [])]); You're right; splat with keys does work. This is something my RFC currently glosses over and should probably be rectified!