Re: Return type declaration and &return.falseforfailure;
| From: | Richard Quadling | Date: | Sun, 11 Feb 2018 21:31:56 +0000 |
| Subject: | Re: Return type declaration and &return.falseforfailure; | ||
| References: | 1 2 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969386882@lists.php.net to get a copy of this message | ||
DocBook 5.2 now supports multiple types, so, really, the form SHOULD/COULD
be
<type>int</type><type>bool</type>
In my opinion, <type>mixed</type> is lazy. We now have scalar type hinting
(though not union type hints which is a shame as that matches the language
itself quite a lot).
If the documentation can be accurate, then it should be.
On 5 December 2017 at 10:15, Andrew Gromov <andrewgrom@rambler.ru> wrote:
> I see many changes from anonymous users like this:
>
> - <type>int</type><methodname>preg_match</methodname>
> + <type>int|bool</type><methodname>preg_match</methodname>
>
>
> or this:
>
> - <type>int</type><methodname>preg_match_all</methodname>
> + <type>mixed</type><methodname>preg_match_all</methodname>
>
>
> Formally them correct, but by spirit them is bad (imho).
>
> Accept or reject them?
>
--
Richard Quadling