Skip to content

Commit 2312f82

Browse files
exit: Add changelog and warning about updated exit code behaviour since PHP 8.4.0 (#5579)
* Add changelog and warning about updated exit code bahaviour since PHP 8.4.0 Co-authored-by: Louis-Arnaud <la.catoire@gmail.com>
1 parent b3a0b99 commit 2312f82

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

reference/funchand/functions/register-shutdown-function.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
function, processing will stop completely and no other registered
2525
shutdown functions will be called.
2626
</para>
27+
<caution>
28+
<simpara>
29+
Since PHP 8.4.0, a parameterless <function>exit</function> call within a
30+
registered shutdown function resets the exit code to <literal>0</literal>.
31+
Calling <function>exit</function> with an explicit status overwrites the
32+
previous exit code in all versions.
33+
</simpara>
34+
</caution>
2735
<para>
2836
Shutdown functions may also call <function>register_shutdown_function</function>
2937
themselves to add a shutdown function to the end of the queue.

reference/misc/functions/exit.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,16 @@
109109
<link linkend="functions.variable-functions">variable functions</link>.
110110
</entry>
111111
</row>
112+
<row>
113+
<entry>8.4.0</entry>
114+
<entry>
115+
A parameterless <function>exit</function> called within
116+
<link linkend="function.register-shutdown-function">shutdown functions</link>
117+
or <link linkend="language.oop5.decon.destructor">object destructors</link>
118+
now resets the exit code to <literal>0</literal>; previously the exit code
119+
set by an earlier <function>exit</function> call was kept.
120+
</entry>
121+
</row>
112122
</tbody>
113123
</tgroup>
114124
</informaltable>

0 commit comments

Comments
 (0)