Split type declaration into its own page#174
Conversation
cmb69
left a comment
There was a problem hiding this comment.
Thanks for working on this! Moving the type declaration documentation to an appropriate place is long overdue, and having union types documented help to simplify the PHP 8.0 migration guide a bit.
| <sect2 xml:id="language.types.declarations.return-only"> | ||
| <title>Return only types</title> | ||
|
|
||
| <sect3 xml:id="language.types.declarations.void"> |
There was a problem hiding this comment.
Would it make sense to somehow unify/merge this section with
doc-en/language/types/pseudo-types.xml
Lines 34 to 43 in cdaea04
and have void's own section (&language.types.void;)? I'd really like to drop the pseudo-types section; mixed is a built-in type as well now, and number could be replaced with the respective union type; and variadics are being worked on already.
There was a problem hiding this comment.
Seems reasonable, I suppose I could add a note which goes along the lines:
<note>
<para>
The PHP documentation uses <literal>void</literal> in an argument list to convey that a function doesn't accept any arguments.
</para>
</note>There was a problem hiding this comment.
Maybe we should drop that as well? Using void to indicate no arguments is a C-ism, I don't think there's any value in doing that in the PHP manual.
|
Also, before actually removing a page from the manual (language/oop5/typehinting.xml in this case), it might be sensible to cater to existing user notes (i.e. integrate or remove). |
The notes all seems updated and irrelevant to some extend by just being benchmarks (I noted that Nikita also removed a bunch just now) |
e9f4a90 to
00c5f0e
Compare
00c5f0e to
7ffa2d0
Compare
|
So I still don't know what to do with the two examples in the temporary "Misc" section, any ideas? |
7ffa2d0 to
8272cf1
Compare
These two examples should probably be better integrated...
Pulled from the RFC
8272cf1 to
8eb85e7
Compare
Also adds a section about union types.