New syntax proposal (type hinting)
| From: | dj.drezyna | Date: | Sat, 23 Mar 2019 20:17:22 +0000 |
| Subject: | New syntax proposal (type hinting) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-104902@lists.php.net to get a copy of this message | ||
I wish have opportunity to set types not only like: function a(): string {} or function b():
?string {} but also as: function c(): string | int {} or function d(): ?string | ?array {}//
all of them should mark that null is accepted. Similar thing is I suppose is in catch{} clause.
Of course not only return types can affected but also types in args. And sometime we can think
about types of properties and variables however this is rather long distance future. So the first
part of this message is could be done in the near future? Dnia 23 marca 2019 20:56 Peter Kokot
<peterkokot@gmail.com> napisał(a): Hello, On Sat, 23 Mar 2019 at 19:45, dj.drezyna
<dj_drezyna@wp.pl> wrote: I wish have opportunity to set types not only like:
function a(): string {} or function b(): ?string {} but also as: function c(): string
| int {} or function d(): ?string | ?array {}// all of them should mark that null is accepted.
Similar thing is I suppose is in catch{} clause. Of course not only return types can
affected but also types in args. And sometime we can think about types of properties and
variables however this is rather long distance future. So the first part of this message is
could be done in the near future? Can you please forward this email to the internals mailing list
instead: internals@lists.php.net Thanks... This mailing list is about *.php.net websites. --
Peter Kokot