jhonatanjacinto's avatar

Jhonatan Jacinto

jhonatanjacinto

Member since

75

Total Reputation

3

Total Arguments

7

Total Votes for Arguments

Arguments and votes

1

I find this syntax pretty messy, to be frank. Maybe it's a good idea (since it is available in "modern languages"), but not something I would use much or even recommend using...

Share:
Read the RFC: The Pipe Operator jhonatanjacinto avatar
jhonatanjacinto
voted no
2

This is a much better approach than having to create getters and setters for validating values before assigning them to properties. Actually, this is an aspect from C# which I really like...

Share:
Read the RFC: Property Hooks jhonatanjacinto avatar
jhonatanjacinto
voted yes
17

In combination with Asymmetric visibility this will allow to replace all getters and setters with trivial properties and occasional hooks.

Share:
Read the RFC: Property Hooks pronskiy avatar
pronskiy
voted yes
36

This is good to have.

Properties are useful for exchanging (reading and writing) single values. Properties are good for data binding, etc.

With this RFC we can implement:

  • Validation
  • Trigger events
  • Call methods if there is more to do

Update: About the $field I am not sure. Having a separate backing field can have some advantages.

Share:
Read the RFC: Property Hooks maz avatar
maz
voted yes
1

This definitely makes life easier. I find myself writing a lot of anonymous functions for commands like array_map, array_filter and so on... and it really makes me sad when I realise I need to have a multi-line function body and need to get back to the default function syntax. It's a simple yet very useful feature PHP could have. Actually, I don't mind keep using the syntax like fn() => as far as it supports a multi-line body and bypasses the need for the use(...$vars) command which is also kind of annoying.

Share:
Read the RFC: Short Closures 2.0 jhonatanjacinto avatar
jhonatanjacinto
voted yes
81

We spend a lot more time reading code than writing it. The elegance of short closure combined with the convenience of variable scope usage has already shown to be a game changer on Typescript and there doesn’t seem to be any technical issue with having it on PHP.

Share:
Read the RFC: Short Closures 2.0 marco avatar
marco
voted yes
121

At least once a week, I throw away an array_map because it ended up looking too bloated and go with a classic foreach instead. Short Closures 2.0 without the use(...) block would've solved this problem, just 2 votes...

Share:
Read the RFC: Short Closures 2.0 davi avatar
davi
voted yes
RSS Feed Contribute Watch on YouTube Our License
© 2024 RFC Vote. This project is open source. Contribute and collaborate with us!