Re: [PHP-DEV] [Proposal] call_user_func_map(): flexible named parameter mapping for call_user_func*

2021-07-01 Thread Mike Schinkel
> On Jul 2, 2021, at 12:30 AM, Hossein Baghayi > wrote: > > Hello, > > On Sun, 27 Jun 2021 at 19:09, Ralph Schindler > wrote: > >> >> This proposes a method for a publisher/framework/producer (the caller of >> the callback) to document all the parameters that are available as named >> para

Re: [PHP-DEV] [Proposal] call_user_func_map(): flexible named parameter mapping for call_user_func*

2021-07-01 Thread Hossein Baghayi
Hello, On Sun, 27 Jun 2021 at 19:09, Ralph Schindler wrote: > > This proposes a method for a publisher/framework/producer (the caller of > the callback) to document all the parameters that are available as named > parameters, and subscribers/consumers (creator of the callback) could > subscribe

Re: [PHP-DEV] Re: [Vote] Partial Function Application

2021-07-01 Thread Olle Härstedt
2021-07-01 17:12 GMT+02:00, Larry Garfield : > On Wed, Jun 16, 2021, at 11:16 AM, Larry Garfield wrote: >> Hi folks. The vote for the Partial Function Application RFC is now >> open, and will run until 30 June. >> >> https://wiki.php.net/rfc/partial_function_application >> >> Of particular note, a

Re: [PHP-DEV] [Proposal] call_user_func_map(): flexible named parameter mapping for call_user_func*

2021-07-01 Thread Ralph Schindler
If you want to ignore arguments in excess, your function may have a rest parameter collecting them. The following will run without error: ```php function foo($c, $a, ...$unused) { var_dump($a, $c); } $args = [ 'a' => 'the a value' , 'b' => 'the b value' , 'c' => 'the c value'

Re: [PHP-DEV] [Proposal] call_user_func_map(): flexible named parameter mapping for call_user_func*

2021-07-01 Thread Ralph Schindler
What I don't understand is what the issue with that is? You can already build up a named array and splat it into a function call to pass by name. It's a really neat trick. It doesn't need a dedicated function. About a month ago, I went through all of TYPO3 and removed all remaining call_u

Re: [PHP-DEV] [Proposal] call_user_func_map(): flexible named parameter mapping for call_user_func*

2021-07-01 Thread Claude Pache
> Le 27 juin 2021 à 16:39, Ralph Schindler a écrit : > > The short proposal: > > > Make a variation of this work (notice parameter order and 'b' is goes unused): > >call_user_func_map( > fn ($c, $a) => var_dump($a, $c), > [ >'a' => 'the a value', >'b' => 'the b

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Marco Pivetta
On Thu, Jul 1, 2021 at 6:06 PM Deleu wrote: > I honestly don't understand not wanting this just because of lack of > cloning. > Agreed: improvements on cloning ergonomics can come later. Also, the problem goes away the smaller your state becomes: this may encourage some design towards more gran

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Pierre
Le 01/07/2021 à 17:25, Larry Garfield a écrit : The most famous use case right now for with-er objects is PSR-7, which is where the naming convention comes from. I cannot say how widely used it is outside of FIG-inspired value objects, but I am pretty sure it is used. As long as you implement

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Deleu
On Thu, Jul 1, 2021 at 5:25 PM Larry Garfield wrote: > On Thu, Jul 1, 2021, at 9:49 AM, Pierre wrote: > > Le 01/07/2021 à 16:38, Nicolas Grekas a écrit : > > > Hi NIkita, > > > > > > I voted against the proposal because it doesn't work with cloning at > all. > > > > > > Cloning is a critical feat

Re: [PHP-DEV] [Proposal] call_user_func_map(): flexible named parameter mapping for call_user_func*

2021-07-01 Thread Larry Garfield
On Thu, Jul 1, 2021, at 10:14 AM, Ralph Schindler wrote: > (Jump to bottom for alternative suggestion that achieves same goals) > > > > > Just to make sure I got this right: call_user_func_map() is the same as > > call_user_func_array(), but a) only accepts named params > > Yes, only accepts n

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Larry Garfield
On Thu, Jul 1, 2021, at 9:49 AM, Pierre wrote: > Le 01/07/2021 à 16:38, Nicolas Grekas a écrit : > > Hi NIkita, > > > > I voted against the proposal because it doesn't work with cloning at all. > > > > Cloning is a critical feature of stateful objects, and we should solve it > > the same version th

[PHP-DEV] PHP 7.4.21 Released!

2021-07-01 Thread Derick Rethans
The PHP development team announces the immediate availability of PHP 7.4.21. This is a security and bug fix release. All PHP 7.4 users are encouraged to upgrade to this version. For source downloads of PHP 7.4.21 please visit our downloads page. Windows binaries can be found on the PHP for Window

Re: [PHP-DEV] [Proposal] call_user_func_map(): flexible named parameter mapping for call_user_func*

2021-07-01 Thread Ralph Schindler
(Jump to bottom for alternative suggestion that achieves same goals) Just to make sure I got this right: call_user_func_map() is the same as call_user_func_array(), but a) only accepts named params Yes, only accepts named parameters (associative array), and b) silently ignores unknown name

[PHP-DEV] Re: [Vote] Partial Function Application

2021-07-01 Thread Larry Garfield
On Wed, Jun 16, 2021, at 11:16 AM, Larry Garfield wrote: > Hi folks. The vote for the Partial Function Application RFC is now > open, and will run until 30 June. > > https://wiki.php.net/rfc/partial_function_application > > Of particular note, a few people had asked about using ...? instead of

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Pierre
Le 01/07/2021 à 16:38, Nicolas Grekas a écrit : Hi NIkita, I voted against the proposal because it doesn't work with cloning at all. Cloning is a critical feature of stateful objects, and we should solve it the same version that introduces readonly IMHO. If we figure out that we can't agree on

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Nicolas Grekas
Le jeu. 1 juil. 2021 à 12:23, Nikita Popov a écrit : > Hi internals, > > I have opened voting on https://wiki.php.net/rfc/readonly_properties_v2. > The vote closes 2021-07-15. > > See https://externals.io/message/114729 for the discussion thread on this > proposal. I think a decent tl;dr is that

Re: [PHP-DEV] [VOTE] Deprecations for PHP 8.1

2021-07-01 Thread Pierre Joye
On Thu, Jul 1, 2021, 9:14 PM Christoph M. Becker wrote: > On 01.07.2021 at 14:15, Pierre Joye wrote: > > > Hi Nikita, > > > > On Wed, Jun 30, 2021, 4:32 PM Nikita Popov wrote: > > > >> Hi internals, > >> > >> I have opened voting on https://wiki.php.net/rfc/deprecations_php_8_1. > The > >> vote

Re: [PHP-DEV] [VOTE] Deprecations for PHP 8.1

2021-07-01 Thread Christoph M. Becker
On 01.07.2021 at 14:15, Pierre Joye wrote: > Hi Nikita, > > On Wed, Jun 30, 2021, 4:32 PM Nikita Popov wrote: > >> Hi internals, >> >> I have opened voting on https://wiki.php.net/rfc/deprecations_php_8_1. The >> vote closes on 2021-07-14. >> >> This RFC is a collection of various deprecation sug

Re: [PHP-DEV] [Vote] Partial Function Application

2021-07-01 Thread Alexandru Pătrănescu
On Thu, Jul 1, 2021 at 3:05 PM Hamza Ahmad wrote: > Hi all, > > While I was reading through the discussion, I found a question related > to the conflict of constant names and functions names. In other words, > `strlen` can be both a constant name and a function name. > This was stated before but

Re: [PHP-DEV] [VOTE] Deprecations for PHP 8.1

2021-07-01 Thread Pierre Joye
Hi Nikita, On Wed, Jun 30, 2021, 4:32 PM Nikita Popov wrote: > Hi internals, > > I have opened voting on https://wiki.php.net/rfc/deprecations_php_8_1. The > vote closes on 2021-07-14. > > This RFC is a collection of various deprecation suggestions from different > people. Each deprecation is vo

Re: [PHP-DEV] [Vote] Partial Function Application

2021-07-01 Thread Hamza Ahmad
Hi all, While I was reading through the discussion, I found a question related to the conflict of constant names and functions names. In other words, `strlen` can be both a constant name and a function name. Thus, in pipe RFC, it can go confusing whether it is a constant or a function name when ca

Re: [PHP-DEV] PHP 8.0.8 Released!

2021-07-01 Thread Remi Collet
Le 01/07/2021 à 13:35, Gabriel Caruso a écrit : The PHP development team announces the immediate availability of PHP 8.0.8. This is a bugfix release. Should read: This is a security and bugfix release Remi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https:/

[PHP-DEV] PHP 8.0.8 Released!

2021-07-01 Thread Gabriel Caruso
The PHP development team announces the immediate availability of PHP 8.0.8. This is a bugfix release. All PHP 8.0 users are encouraged to upgrade to this version. For source downloads of PHP 8.0.8 please visit our downloads page. Windows binaries can be found on the PHP for Windows site. The list

Re: [PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Hamza Ahmad
Hi Nikita, It is going to be the second contribution from you regarding OOP. However, this proposal, as you have mentioned, has some issues with cloning. What if you would have opened voting after fixing this? Or, your mood is to get it passed and then fix it before final release of 8.1? Thank y

[PHP-DEV] [VOTE] Readonly properties

2021-07-01 Thread Nikita Popov
Hi internals, I have opened voting on https://wiki.php.net/rfc/readonly_properties_v2. The vote closes 2021-07-15. See https://externals.io/message/114729 for the discussion thread on this proposal. I think a decent tl;dr is that readonly properties as proposed do not play well with clone-based w

[PHP-DEV] PHP 7.3.29 Released!

2021-07-01 Thread Christoph M. Becker
The PHP development team announces the immediate availability of PHP 7.3.29. This is a security release. All PHP 7.3 users are encouraged to upgrade to this version. For source downloads of PHP 7.3.29 please visit our downloads page. Windows binaries can be found on the PHP for Windows site. The