Re: STH Docs.
| From: | Peter Cowburn | Date: | Wed, 29 Apr 2015 13:04:30 +0000 |
| Subject: | Re: STH Docs. | ||
| References: | 1 2 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969385617@lists.php.net to get a copy of this message | ||
On 27 April 2015 at 19:53, Rowan Collins <rowan.collins@gmail.com> wrote:
> Pasindu De Silva wrote on 27/04/2015 04:37:
>
>> Hi Guys
>> I am doing some documentation for STH but not sure where to put it.
>> Current type hintings are under oop5 (
>> http://php.net/manual/en/language.oop5.typehinting.php).
>> So should we make something called oop7 and put STH under that or else
>> under oop5.
>>
>
> Technically, the new type hinting features have nothing to do with OOP,
> since the whole point is that we're hinting types other than objects.
> (Arguably, that was already true of "array" and "callable", added in 5.1
> and 5.4, respectively.)
>
We should definitely have a page/section about hinting for function
parameters, out-with the oop5 section... that is a long overdue change.
>
> I would have thought the page should be moved into either the "Types"
> chapter [1] (which covers Type Juggling) or the "Functions" chapter [2]
> (which covers things like default and variable-length argument lists), with
> a clear note about which parts are new to PHP 7.
>
The "functions" chapter should detail parameter and return type hinting;
either in a "type hinting" section, and/or by mentioning them in the
existing "function arguments" and "returning values" sections.
>
> "language.oop5.typehinting" should then become some kind of redirect (I'm
> not sure what the options are for that outside function aliases...)
>
Either a redirect, or a much briefer page describing type hinting as
applies to "OOP" and making reference to the (unwritten, as yet) type
hinting for functions page(s).
>
> [1] http://php.net/manual/en/language.types.php
> [2] http://php.net/manual/en/language.functions.php
>
> Regards,
> --
> Rowan Collins
> [IMSoP]
>