Skip to content

spl_object_hash() is deprecated in PHP 8.6 (SchemaLoader.php:442) #175

Closed

Description

@rasuvaeff

Summary

SchemaLoader::getSchemaId() (src/SchemaLoader.php, line 442) calls spl_object_hash(), which is deprecated as of PHP 8.6:

Function spl_object_hash() is deprecated since 8.6, consider using spl_object_id() instead

Impact

Any validation that hits this code path on PHP 8.6 emits a deprecation notice. Projects that convert deprecations to exceptions (test suites, strict error handlers) fail hard.

I hit this via the official MCP PHP SDK (mcp/sdk), which requires opis/json-schema ^2.4 — our test suite started failing on the PHP 8.6 job with:

Schema validation process failed: Function spl_object_hash() is deprecated since 8.6, consider using spl_object_id() instead

Suggested fix

Use spl_object_id() instead — it exists since PHP 7.2, and the package already requires php: ^7.4 || ^8.0, so no compatibility concern.

Happy to send a PR if welcome.

Activity

  1. sorinsarca commented on Nov 11, 2026

    @sorinsarca
    Member

    Already fixed in #174

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions