Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions language/types/void.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
<link linkend="language.types.type-system.composite.union">union type</link>
declaration. Available as of PHP 7.1.0.
</para>
<simpara>
A <literal>return</literal> statement with an expression in a
<type>void</type> function is a compile-time error, even if the
<literal>return</literal> would not be reached during execution.
This includes <literal>return null;</literal>; use a bare
<literal>return;</literal> to exit the function early. The
<literal>null</literal> mentioned below is only the implicit value of
the call.
</simpara>

<note>
<simpara>
Expand Down
Loading