Re: [PHP-DEV] [RFC] Destructuring Coalesce

2022-10-16 Thread David Rodrigues
I like it! But what should happen if: [ $a ?? '123', $b ] = []; [ $a ?? '123', $b ] = [ 1 ]; [ $a ?? '123', $b ] = [ 1, 2 ]; It also supports ?: operator? [ $a ?: '123' ] = []; so $a = '123' [ $a ?: '123' ] = [ false ]; so $a = '123' [ $a ?: '123' ] = [ 456 ]; so $a = 456 Atenciosamente, Davi

[PHP-DEV] [RFC] Destructuring Coalesce

2022-10-16 Thread Bob Weinand
Hey, I've written a small RFC about adding coalesce ability to list() destructuring. This should enhance the ability to easily, concisely and readably destructure arrays with default values. https://wiki.php.net/rfc/destructuring_coalesce Bob

Re: [PHP-DEV] RFC [Discussion]: Randomizer Additions

2022-10-16 Thread Dan Ackroyd
Hello Joshua, > Shall an option be added to getFloat() that changes the logic to select from [$min, $max] (i.e. allowing the maximum to be returned)? And how should that look like? Boolean parameter? Enum? An enum would probably be nice, and possibly be for all four cases of min_(inclusive|exclus