[doc-en] master: language: document the PHP 8.4 comparison and readonly clone BC breaks (#5775)

From: Date: Fri, 21 Aug 2026 14:26:42 +0000
Subject: [doc-en] master: language: document the PHP 8.4 comparison and readonly clone BC breaks (#5775)
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-23606@lists.php.net to get a copy of this message
Author: Louis-Arnaud (lacatoire) Committer: GitHub (web-flow) Pusher: lacatoire Date: 2026-08-21T16:26:39+02:00 Commit: https://github.com/php/doc-en/commit/62e61e543c2d2b8519952efa246ed708026cfb16 Raw diff: https://github.com/php/doc-en/commit/62e61e543c2d2b8519952efa246ed708026cfb16.diff language: document the PHP 8.4 comparison and readonly clone BC breaks (#5775) * language: document the PHP 8.4 comparison and readonly clone BC breaks * Update comparison.xml Co-authored-by: Jordi Kroon <jordi@jordikroon.nl> --------- Co-authored-by: Jordi Kroon <jordi@jordikroon.nl> Changed paths: M language/oop5/properties.xml M language/operators/comparison.xml Diff: diff --git a/language/oop5/properties.xml b/language/oop5/properties.xml index 9fc60965ea20..a40df2528bab 100644 --- a/language/oop5/properties.xml +++ b/language/oop5/properties.xml @@ -361,6 +361,14 @@ var_dump($test2->prop); // NULL </programlisting> </example> </para> + <note> + <simpara> + As of PHP 8.4.0, indirect modification of a readonly property within + <link linkend="object.clone">__clone()</link>, such as acquiring a + reference to it (<code>$ref = &amp;$this->prop</code>), is no longer + allowed. This was already forbidden during readonly initialization. + </simpara> + </note> </sect2> <sect2 xml:id="language.oop5.properties.dynamic-properties"> diff --git a/language/operators/comparison.xml b/language/operators/comparison.xml index 44c6a491ad4d..b8f8a061d44d 100644 --- a/language/operators/comparison.xml +++ b/language/operators/comparison.xml @@ -330,6 +330,15 @@ function standard_array_compare($op1, $op2) </simpara> </note> + <note> + <simpara> + Encountering recursion during comparison, for example when comparing an + array or object that contains a reference to itself, throws an + <exceptionname>Error</exceptionname> as of PHP 8.4.0; previously, + it resulted in a fatal error. + </simpara> + </note> + <sect2 xml:id="language.operators.comparison.incomparable"> <title>Incomparable Values</title> <simpara>

« previous php.doc.cvs (#23606) next »