Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions reference/funchand/functions/register-shutdown-function.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
function, processing will stop completely and no other registered
shutdown functions will be called.
</para>
<caution>
<simpara>
Since PHP 8.4.0, a parameterless <function>exit</function> call within a
registered shutdown function resets the exit code to <literal>0</literal>.
Calling <function>exit</function> with an explicit status overwrites the
previous exit code in all versions.
</simpara>
</caution>
<para>
Shutdown functions may also call <function>register_shutdown_function</function>
themselves to add a shutdown function to the end of the queue.
Expand Down
10 changes: 10 additions & 0 deletions reference/misc/functions/exit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@
<link linkend="functions.variable-functions">variable functions</link>.
</entry>
</row>
<row>
<entry>8.4.0</entry>
<entry>
A parameterless <function>exit</function> called within
<link linkend="function.register-shutdown-function">shutdown functions</link>
or <link linkend="language.oop5.decon.destructor">object destructors</link>
now resets the exit code to <literal>0</literal>; previously the exit code
set by an earlier <function>exit</function> call was kept.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
Expand Down