Skip to content

fix(hal): use spl_object_id() for circular reference counters - #8657

Merged
soyuka merged 1 commit into
api-platform:5.0from
dualfroz:fix/hal-spl-object-id
Oct 9, 2026
Merged

soyuka merged 1 commit into
api-platform:5.0from
dualfroz:fix/hal-spl-object-id

Conversation

@dualfroz

@dualfroz dualfroz commented Oct 7, 2026

Copy link
Copy Markdown
Q A
Branch? 5.0
Tickets -
License MIT
Doc PR -

spl_object_hash() is deprecated in PHP 8.6, and the HAL ItemNormalizer calls it in isHalCircularReference() on every item it normalizes. The hash is only used as a key for the circular reference counters, so spl_object_id() is a drop-in replacement (same change as doctrine/dbal#7518).

ValidationException::getId() still uses spl_object_hash(), but its value ends up in the error IRI, so it is left out of this fix.

spl_object_hash() is deprecated in PHP 8.6, and the HAL ItemNormalizer
calls it in isHalCircularReference() on every item it normalizes. The
hash is only used as a key for the circular reference counters, so
spl_object_id() is a drop-in replacement (same change as
doctrine/dbal#7518).
@dualfroz
dualfroz force-pushed the fix/hal-spl-object-id branch from 835c0b9 to 5704820 Compare October 8, 2026 09:42
@soyuka
soyuka merged commit 3779894 into api-platform:5.0 Oct 9, 2026
116 of 117 checks passed
@soyuka

soyuka commented Oct 9, 2026

Copy link
Copy Markdown
Member

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants