Re: [PHP-DEV] [VOTE] Improve unserialize() error handling

2022-10-19 Thread Tim Düsterhus
Hi On 10/19/22 06:14, Tim Starling wrote: The example in the RFC was written to be correct for the general case, without imposing any constraints in the input data. As I said, if throwing was optional, like in json_decode(), I would be all for it. I'm just doing a cost/benefit analysis. The

Re: [PHP-DEV] Compact can't resolve outer scoped variables using short closures

2022-10-19 Thread David Rodrigues
> I'd rather hope for `compact()` to finally be deprecated and targeted for removal  I think compact() is a good function for transferring variables from one point to another, but I would think about making improvements as it is confusing (uses the variable name, rather than the variable

Re: [PHP-DEV] [VOTE] Improve unserialize() error handling

2022-10-19 Thread Tim Düsterhus
Hi On 10/18/22 14:04, Dan Ackroyd wrote: function getUserPreferences($data) { $user_preferences = @unserialize($data); if ($user_preferences === false) { $user_preferences = get_default_preferences(); } return $user_preferences; } […] I agree that this implementation

Re: [PHP-DEV] Compact can't resolve outer scoped variables using short closures

2022-10-19 Thread Marco Pivetta
On Wed, 19 Oct 2022, 19:04 David Rodrigues, wrote: > Hello! > > I'm converting my code to use short closures where possible, and I ran into > a problem using compact(). > > Basically, the names used in compact() cannot be accessed due to a bug, > reported in 2019 still in PHP 7.4 (ID 78970). > >

[PHP-DEV] Compact can't resolve outer scoped variables using short closures

2022-10-19 Thread David Rodrigues
Hello! I'm converting my code to use short closures where possible, and I ran into a problem using compact(). Basically, the names used in compact() cannot be accessed due to a bug, reported in 2019 still in PHP 7.4 (ID 78970). https://bugs.php.net/bug.php?id=78970 It seems to me to be a

Re: [PHP-DEV] Should the engine be able to pass variables by reference of userland functions

2022-10-19 Thread Jordan LeDoux
On Wed, Oct 19, 2022 at 7:37 AM Kamil Tekiela wrote: > Hi, > > I am not sure if we should still support it. But I don't think it's > unthinkable to expect such feature from PHP. However, personally, I don't > find pass-by-ref that useful in general. The question is whether this > feature is used

Re: [PHP-DEV] Should the engine be able to pass variables by reference of userland functions

2022-10-19 Thread Kamil Tekiela
Hi, I am not sure if we should still support it. But I don't think it's unthinkable to expect such feature from PHP. However, personally, I don't find pass-by-ref that useful in general. The question is whether this feature is used a lot in the wild. If we decide to drop support for this, it

[PHP-DEV] Should the engine be able to pass variables by reference of userland functions

2022-10-19 Thread G. P. B.
Hello internals, While working on cleaning up the FCI/FCC API I stumbled upon the zend_fcall_info_args_ex() function. This function allows the engine to pass "variables" to userland functions that expect a by-ref parameter. This is currently only used within php-src in PDO when calling the