Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112081 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 66455 invoked from network); 20 Oct 2020 19:02:53 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Oct 2020 19:02:53 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7C1B31804D9 for ; Tue, 20 Oct 2020 11:19:51 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 20 Oct 2020 11:19:50 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id E094B968 for ; Tue, 20 Oct 2020 14:19:48 -0400 (EDT) Received: from imap26 ([10.202.2.76]) by compute4.internal (MEProxy); Tue, 20 Oct 2020 14:19:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=ixZWAztgalH9F5KWFc08EZweb6jp7 +PLbrxUv340eoo=; b=iMO2r4cawDz206IqPhGqAt3wK/GArQXSDIGmyfd0Cs4zp o2gmv4W9JJN86/66VPbF3FaweYaf7zzXFJMzwW3W9QHrffpypbj6kYRi/Ye1KOkq 3wVotJzU7nXyqgzaGpjcV9rHM9WhLVGbBTxg91DOBfnFO0W9Dx+2chZ86bNqtNUs 42PLLEb6ktdFF8j2S6zDt04q0Wl/53/rETDhtBssVwEz1KemdA9Y+ndY63XDvFmG MM5M0AxG9GEeVxZstKoPfPJK6KxfnwxBajN8lqm1kZQRVxds6ms72PWOOQZFJkYi asVpi0AvSsY5qmWSgwvl27D6Y3h6y0GQRYp0nuNjQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrjeefgdduvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkfffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghrrhih ucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqe enucggtffrrghtthgvrhhnpeegheffiefhtdekfeevffeuieeihfejudfhuefhtdetleel hfdvjeetkefggfeuieenucffohhmrghinhepphhhphdrnhgvthenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghl ughtvggthhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3E42C14200A2; Tue, 20 Oct 2020 14:19:48 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-502-gfef6c88-fm-20201019.001-gfef6c888 Mime-Version: 1.0 Message-ID: Date: Tue, 20 Oct 2020 13:19:09 -0500 To: "php internals" Content-Type: text/plain Subject: [RFC] Short-function syntax From: larry@garfieldtech.com ("Larry Garfield") 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