Re: Function list declaration syntax?
| From: | Dan Ackroyd | Date: | Tue, 05 Oct 2021 19:18:05 +0000 |
| Subject: | Re: Function list declaration syntax? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-116233@lists.php.net to get a copy of this message | ||
On Tue, 5 Oct 2021 at 18:47, Mike Schinkel <mike@newclarity.net> wrote:
> Consider the
Type class[3] in the
> SebastianBergmann\Type namespace. It contains 60 lines of function
> declaration to define 14 functions that all return false.
PHP allows you to define functions on one line:
function isCallable(): bool { return false; }
function isFalse(): bool { return false; }
function isGenericObject(): bool { return false; }
If you don't like having functions take up lots of lines, it's easier
to just not follow that PSR guide line on formatting, rather than
modify the language.
cheers
Dan
Ack