rinodrummer's avatar

Gennaro Landolfi

rinodrummer

Member since

45

Total Reputation

3

Total Arguments

3

Total Votes for Arguments

Arguments and votes

1

If we remove parentheses for this case, why having them for the if statement and so on?

I think it's necessary for the parentheses to be kept because you have to prioritize the object instanciation to use a method it exposes.

Share:
Read the RFC: new MyClass()->method() without parentheses rinodrummer avatar
rinodrummer
voted no
1

It simplifies dedicated logic for setters/getters, without having to mess directly with __get() and __set().

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

Short doesn't mean one line, sometimes few lines may be needed to express the operation.

Another advantage of closures is the access to the outer scope.

Most important thing is to not abuse of this feature and switch to this syntax instead of the canonical function syntax.

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