Skip to content

Avoid deprecated spl_object_hash() on PHP 8.6 - #300

Open
andypost wants to merge 1 commit into
bovigo:v1.6from
andypost:php86-spl-object-id
Open

Avoid deprecated spl_object_hash() on PHP 8.6#300
andypost wants to merge 1 commit into
bovigo:v1.6from
andypost:php86-spl-object-id

Conversation

@andypost

Copy link
Copy Markdown

PHP 8.6 deprecates spl_object_hash() in favor of spl_object_id().

Use spl_object_id() where it is available and cast the ID to string to preserve getResourceId()'s documented return value. The function_exists() fallback keeps support for PHP 7.1, where spl_object_id() does not exist.

Same change for the master branch: the companion PR targets 2.x without the fallback.

Fixes #299

PHP 8.6 deprecates spl_object_hash() in favor of spl_object_id().
Use spl_object_id() where available and cast to string to preserve
getResourceId()'s documented return value. The fallback keeps
support for PHP 7.1, where spl_object_id() does not exist.

Fixes bovigo#299
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.

1 participant