language: document the PHP 8.4 comparison and readonly clone BC breaks - #5775
Merged
Conversation
jordikroon
reviewed
Aug 19, 2026
jordikroon
approved these changes
Aug 19, 2026
Co-authored-by: Jordi Kroon <jordi@jordikroon.nl>
lacatoire
force-pushed
the
language-8.4-bc
branch
from
August 21, 2026 10:01
055a787 to
769e0da
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents the two remaining PHP 8.4 core language BC breaks:
__clone()is no longer allowed, for example acquiring a reference to it. Added as a note to the readonly properties section, right after the PHP 8.3 clone reinitialization paragraph.Errorinstead of raising a fatal error. Added as a note to the comparison operators page.Tracker: both items are on the PHP 8.4 Documentation Tracker, listed as "(BC Break) Indirect Modification of readonly Properties" and "(BC Break) Recursion during comparison".
Sources:
__clone(): UPGRADING for PHP 8.4, php-src #15012 (commit46ee0fb), testZend/tests/readonly_props/readonly_clone_error7.phpt.82479e8), implementation inZend/zend_hash.candZend/zend_object_handlers.c, testZend/tests/recursive_array_comparison.phpt.Verified on
php:8.3-cliandphp:8.4-cli:The comparison note deliberately says "encountering recursion during comparison" rather than referring to a maximum nesting level: the check is a recursion guard, and a single self-referencing value compared against a plain one is enough to trigger it. Comparing a value with itself (
$a === $a) still returnstrue.