Re: Return type declaration and &return.falseforfailure;
| From: | Christoph M. Becker | Date: | Sun, 11 Feb 2018 22:19:45 +0000 |
| Subject: | Re: Return type declaration and &return.falseforfailure; | ||
| References: | 1 2 3 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969386883@lists.php.net to get a copy of this message | ||
On 11.02.2018 at 22:31, Richard Quadling wrote:
> 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.
Well, then we'd have to add NULL as return type to almost every
function. IMHO, not really helpful.
> 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?
--
Christoph M. Becker