Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-29 Thread Dan Ackroyd
On Wed, 29 Jun 2022 at 18:30, Larry Garfield wrote: > > The conversation has died down, so we'll be opening the vote for this > tomorrow. I think I've just thought of a problem with the optimization bit of 'not capturing variables if they are written to before being used inside the closure'. Im

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-29 Thread Björn Larsson via internals
Den 2022-06-29 kl. 19:30, skrev Larry Garfield: On Thu, Jun 9, 2022, at 11:34 AM, Larry Garfield wrote: Last year, Nuno Maduro and I put together an RFC for combining the multi-line capabilities of long-closures with the auto-capture compactness of short-closures. That RFC didn't fully go to co

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-29 Thread Larry Garfield
On Thu, Jun 9, 2022, at 11:34 AM, Larry Garfield wrote: > Last year, Nuno Maduro and I put together an RFC for combining the > multi-line capabilities of long-closures with the auto-capture > compactness of short-closures. That RFC didn't fully go to completion > due to concerns over the perfor

Re: [PHP-DEV] [RFC] Exception type hint

2022-06-29 Thread Larry Garfield
On Wed, Jun 29, 2022, at 10:42 AM, Guilliam Xavier wrote: > Hi (note: your message was flagged as spam), > >> https://github.com/php/php-src/issues/8843 > > So I understand it as having a "true code" equivalent for the > `@throws` phpDoc comment (similar to type declarations for `@param` > and `@re

Re: [PHP-DEV] [RFC] Exception type hint

2022-06-29 Thread Guilliam Xavier
Hi (note: your message was flagged as spam), > https://github.com/php/php-src/issues/8843 So I understand it as having a "true code" equivalent for the `@throws` phpDoc comment (similar to type declarations for `@param` and `@return`)? which would also be checked at run-time? Just my 2 cents on

Re: [PHP-DEV] [RFC] [Under Discussion] Random Extension Improvement

2022-06-29 Thread Tim Düsterhus
Hi On 6/29/22 10:40, Guilliam Xavier wrote: pickArrayKeys [but the opposite would not be so], and I don't think that adding *both* methods to Randomizer is desirable either [better keep it simple/minimal]). Agreed. I think it's best to leave pickArrayKeys() as it is within the current version

Re: [PHP-DEV] [RFC] [Under Discussion] Random Extension Improvement

2022-06-29 Thread Guilliam Xavier
>> > https://wiki.php.net/rfc/random_extension_improvement >> >> I just realized a little thing: in the array_rand() example, for >> $beforeSingle, it would probably be "more realistic" to omit `, 1` >> (which is already the default for $num). >> >> Note: for `Randomizer::pickArrayKeys(array $array