Re: [RFC] Partial function application

From: Date: Fri, 14 May 2021 22:45:50 +0000
Subject: Re: [RFC] Partial function application
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-114476@lists.php.net to get a copy of this message
On 14/05/2021 22:48, Aaron Piotrowski wrote:
I think it’s reasonable to allow passing more arguments to a partial since user-defined functions and closures allow this without error.
But only userland functions, a relic from when func_get_args was the only way to handle varaible numbers of arguments. The documentation officially discourages func_get_args in favour of ...$ so I can definitely forsee the option of us deprecating that mechanism sometime in 8.x and and removing it in 9.0. I don't think it likely that it would go the other way of allowing unlimited arguments to internal functions. That being the case, IMO it makes more sense to introduce partials with the same behaviour as internal functions, passing more functions than specified (including partial arguments) should error.

Thread (68 messages)

« previous php.internals (#114476) next »