Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113762 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 88380 invoked from network); 25 Mar 2021 10:17:53 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Mar 2021 10:17:53 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 05BA11804DC for ; Thu, 25 Mar 2021 03:13:52 -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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 25 Mar 2021 03:13:51 -0700 (PDT) Received: by mail-lj1-f171.google.com with SMTP id r20so2402051ljk.4 for ; Thu, 25 Mar 2021 03:13:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=9vw7m+eZ17eJ0dO1YAlZkF/SMAOdqQhI8ADhRO6oI9Y=; b=mVJNJqE19ITHg4t+lsX/Zi5aNT3r+LWrACT29Gd1THo8SCdOIsPJfJDdmp6JZDHV5Q mu5CBC4t+hEqnV3EukXRvzu6H/4q5JX3t0zwOimRDID0C/W50wYCJq41tvLFd3MUI10Z 56Ae6hVEXa4GtYNwIuIridIfS+rAE6iO5+sLpR/xOpS/dwfDVEQbwdrxZF5e5aHphs2c cAmzAqO3k5OAHkYS0cCw+AGChmQ8Pl7qR3I/3L3J07RXqvQtxz35b5/FH+k21CfjesqT S1dKkiZTumbR54kfCEW3jh6o4KwTKS+9agSazz7VmjjzyeTphrvXqUt3nb9w8khCWYzc LG6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=9vw7m+eZ17eJ0dO1YAlZkF/SMAOdqQhI8ADhRO6oI9Y=; b=R1mBMH9nM/hlhXiJ0QOkztTgBruvknnOobJZTBU38hG8MEXlUnMJl/33Vk+ockkASo pKNFvaAqR1jQ/I+WT6nWzmo21t7lKE7ldMfY2Ugdprc4x8N3dGLBD6OPA+W493mW8Y16 CfJlRe2OUaAO6m55kfAATOcgMEiEWMtTrX8M4uZKeaa7Xn9b6Y19/Mi/w3GI0o3SIwRH loso9ErUrhREsArygRg0/dh+k/K5jivcAUoYwsmEomXDvHMG76f0KzgSwxNIBa1ry9bv GaEz2YqSuvRUI5CnIuuKwi1QsAEHFPgh+GWA/d5iJ2xeGzhXIv+rNUrYWWm7A/5eCfDK sFOw== X-Gm-Message-State: AOAM531Wgf9RpiSHkJRpnEikp6B+z3PNUW4MpeMZjt/mbPpckvwAt7GL vtG6eW1cIo6ha9o3tAgzdNVluH+7/hStG0hn6ta3RnondqMv X-Google-Smtp-Source: ABdhPJwh88v62/MeHqycB8/bqXJjbgZawxlYQjPBvKEV65bXNSkVXxBZoyeB+xHkORvPCm7yov966g9L36f2Vh64Hak= X-Received: by 2002:a2e:a17c:: with SMTP id u28mr4972609ljl.22.1616667228254; Thu, 25 Mar 2021 03:13:48 -0700 (PDT) MIME-Version: 1.0 References: <44ac7866-75ef-44ab-a5f9-4e571652b5e6@www.fastmail.com> <21C66BCC-A77D-48B0-A653-9D65ADF06A3B@newclarity.net> In-Reply-To: Date: Thu, 25 Mar 2021 11:13:37 +0100 Message-ID: To: php internals Content-Type: multipart/alternative; boundary="000000000000dc352a05be59ab1c" Subject: Re: [PHP-DEV] [RFC] Short functions, take 2 From: guilliam.xavier@gmail.com (Guilliam Xavier) --000000000000dc352a05be59ab1c Content-Type: text/plain; charset="UTF-8" On Thu, Mar 25, 2021 at 4:23 AM Levi Morrison via internals < internals@lists.php.net> wrote: > [...] > Instead of writing this: > > ``` > class A > { > public function method($arg1) > { > return expr($arg1); > } > } > ``` > > I can write this: > > ``` > class A { > function method($arg1) { return expr($arg1); } > } > ``` > For what it's worth (probably not much), when fiddling with quick test code samples (e.g. on 3v4l with "quick preview"), more than once I have written things like this: ``` class A { function method($arg1) { expr($arg1); } } ``` i.e. I initially forgot the "return " (and had to go back and add it). I would surely not have this problem anymore with this: ``` class A { function method($arg1) => expr($arg1); } ``` (It also seems I don't have this problem when writing a return on its own line :/) Regards, -- Guilliam Xavier --000000000000dc352a05be59ab1c--