[RFC] Short-function syntax

From: Date: Tue, 20 Oct 2020 18:19:09 +0000
Subject: [RFC] Short-function syntax
Groups: php.internals 
Request: Send a blank email to internals+get-112081@lists.php.net to get a copy of this message
A while back, Nikita mentioned that it should now be easy to offer an abbreviated syntax for functions that are just a single expression. I decided to take a crack at it and it turns out he was right. I thus offer this RFC: https://wiki.php.net/rfc/short-functions Hopefully I made a decent enough case for it. It's entirely a convenience factor, but I think for many OOP cases (getter methods and factored out operations) and functional cases (where functions should generally be a single expression conceptually) it does make the code nicer, more compact, and more readable. *dons flame retardant suit* -- Larry Garfield larry@garfieldtech.com

« previous php.internals (#112081) next »