[PHP-DEV] [VOTE] Random Extension Improvement

2022-07-02 Thread Go Kudo
Hello internals.

Voting began on 2022-07-02 03:00:00 (UTC) and will end on 2022-07-16
03:00:00 (UTC).

https://wiki.php.net/rfc/random_extension_improvement

Best Regards,
Go Kudo


Re: [PHP-DEV] [RFC] [VOTE] Disjunctive Normal Form Types

2022-07-02 Thread G. P. B.
On Fri, 17 Jun 2022 at 16:19, G. P. B.  wrote:

> Hello internals,
>
> I've started the vote for the Disjunctive Normal Form Types RFC:
> https://wiki.php.net/rfc/dnf_types
>
> The vote will last for 2 weeks and end on the 1st of July
>

I'm glad to announce that the RFC has been accepted with 25 votes in favour
and 1 against.
Apologies for overrunning the vote as I forgot this happened on Friday.

Best regards,

George P. Banyard


Re: [PHP-DEV] [RFC][Vote] Auto-capture closures

2022-07-02 Thread Rowan Tommins

On 01/07/2022 15:04, Larry Garfield wrote:

Greetings, Internalians.

The vote for auto-capture closures is now open.  It will run until 15 July.

https://wiki.php.net/rfc/auto-capture-closure



I have voted No, because although I am more-or-less convinced that 
auto-capture is a useful feature, I don't think this is the right syntax 
for it.


- Having "fn" and "function" mean almost the same thing, but with such 
an important difference, feels like a WTF waiting to happen.


- The RFC seems to take for granted that shorter syntax is better, 
calling explicit syntax "noise"; but in that case PHP contains a lot of 
"noise", and I'm not convinced that removing it would be a good thing.


- This emphasis also implies that auto-capture is a near-universal 
improvement over explicit capture, rather than an alternative on equal 
footing: it is the version that deserves the very best syntax possible. 
I remain unconvinced by this.


- Unlike other languages, PHP normally relies on opting into scope 
imports (global, $this->, etc), so lacks a mechanism to opt out and 
declare a variable as local (var, let, etc). The proposed syntax offers 
neither opt-in nor opt-out, relying on the implementation to do the 
right thing automatically ... most of the time.



To re-iterate, I am not opposed to the feature in principle, but would 
have loved to see a more open exploration of different syntax options.



Regards,

--
Rowan Tommins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php



Re: [PHP-DEV] [RFC][Vote] Auto-capture closures

2022-07-02 Thread Hans Henrik Bergan
>But do any of them auto-capture by value?

in c++ it's optional if you want to capture-by-value or
capture-by-reference, [&]()->void{...}(); captures everything by reference
and [=]()mutable->void{...}(); captures everything by value

> I think that's still explicit

fair assessment


On Sat, 2 Jul 2022 at 05:02, Anton Smirnov  wrote:

> On Fri, 2022-07-01 at 16:11 +0200, Hans Henrik Bergan wrote:
> > > As far as we are aware, only two languages in widespread use
> > > require variables to be explicitly closed over: PHP and C++. All
> > > other major languages capture implicitly, as is proposed here.
>
> But do any of them auto-capture by value?
>
> > to be fair to c++, it supports [&] to capture everything, like
> > int a=1,b=2,c=3;[&]()->void{std::cout << a << b << c;}();
>
> I think that's still explicit
>
> --
> Anton
>