Re: [RFC] Short-function syntax

From: Date: Mon, 26 Oct 2020 17:10:02 +0000
Subject: Re: [RFC] Short-function syntax
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-112126@lists.php.net to get a copy of this message
Hi David, pon., 26 paź 2020 o 15:29 David Rodrigues <david.proweb@gmail.com> napisał(a): > > The use of > instead of => could if possible indicate the method being > void > > and reduce even more: > > I think that for void, it could just identify it and not return nothing > automatically. > > function a(): int => b(); // equivalents to function a(): int { return > b(); } > function x(): void => y(); // equivalents to function x(): void { y(); } > Sure, but I've used > without adding return type ':void' intentionally what could possibly indicate the void if talking about reducing the return type at all for void methods. Cheers, Michał Marcin Brzuchalski

« previous php.internals (#112126) next »