---
title: "API Platform: PHP 8.6 and Symfony 8.1 deprecations | VulCode"
description: "Two fixes to API Platform in PHP: HAL circular reference counting without the deprecated spl_object_hash(), and deserialisation errors without getErrors()."
url: "https://vulcode.com/en/opensource/contributions/api-platform"
lang: "en"
---

[All contributions](https://vulcode.com/en/opensource/contributions)

api-platform/core

# API Platform

The server part of API Platform, a Symfony-based PHP framework for building hypermedia REST and GraphQL APIs.

[See the repository](https://github.com/api-platform/core) [All contributions](https://vulcode.com/en/opensource/contributions)

- **Language**: PHP
- **GitHub stars**: 2,582
- **Merged changes**: 2
- **Project site**: [api-platform.com](https://api-platform.com)

## What we changed

The HAL normaliser counts circular references by spl_object_id() instead of spl_object_hash(), which PHP 8.6 deprecates, and DeserializeProvider collects deserialisation errors without a method Symfony Serializer 8.1 deprecates.

### What this work shows

- HAL and Symfony Serializer normalisers

- Moving off APIs deprecated in PHP 8.6 and Symfony 8.1

- PHPUnit tests that catch deprecations

What was broken

### A PHP 8.6 deprecation on every HAL item

The HAL ItemNormalizer calls isHalCircularReference() for every item it normalises. That function used spl_object_hash(), which PHP 8.6 deprecates.

How we fixed it

### spl_object_id() as the counter key

The hash was only a key for the circular reference counters, so we replaced it with spl_object_id() without changing behaviour. We left ValidationException::getId() alone, because its value ends up in the error IRI.

[#8657](https://github.com/api-platform/core/pull/8657)

What was broken

### A deprecated method when collecting errors

When collecting deserialisation errors, DeserializeProvider called PartialDenormalizationException::getErrors(), which Symfony Serializer 8.1 deprecates. The functional tests had to expect that deprecation.

How we fixed it

### The new method with a 7.4 fallback

DeserializeProvider uses getNotNormalizableValueErrors() when it exists and falls back to getErrors() on Symfony Serializer 7.4, the same guard as on the 5.0 branch. A new test checks that the error reaches the violation list with no deprecation, and the functional tests no longer expect one.

[#8663](https://github.com/api-platform/core/pull/8663)

## Merged changes 2

- [#8663 fix(state): avoid deprecated PartialDenormalizationException::getErrors() Merged 13 October 2026](https://github.com/api-platform/core/pull/8663)

- [#8657 fix(hal): use spl_object_id() for circular reference counters Merged 9 October 2026](https://github.com/api-platform/core/pull/8657)

## What it taught us

We start replacing a deprecated call by checking what the value is for: an array key can be swapped right away, while an identifier in an error address needs a decision of its own. When a project supports several versions of a dependency, we check whether the new method exists instead of raising the requirement.

[More about this technology: PHP](https://vulcode.com/en/technologies/php)

## Other projects we write code for

- [**Composer** PHP · 29,590 stars The dependency manager for PHP: it installs and updates a project's libraries from its composer.json.](https://vulcode.com/en/opensource/contributions/composer)

- [**PHPMailer** PHP · 22,347 stars The classic PHP library for sending email, used by WordPress and many other systems.](https://vulcode.com/en/opensource/contributions/phpmailer)

- [**Monolog** PHP · 21,407 stars A PHP logging library that sends records to files, sockets, inboxes, databases and web services. Symfony and Laravel use it, among others.](https://vulcode.com/en/opensource/contributions/monolog)

- [**Carbon** PHP · 16,583 stars A PHP DateTime extension for working with dates, standard in the Laravel ecosystem.](https://vulcode.com/en/opensource/contributions/carbon)

- [**Whoops** PHP · 13,231 stars A PHP library that turns uncaught exceptions into a readable error page with the stack trace, known from Laravel.](https://vulcode.com/en/opensource/contributions/whoops)

- [**ramsey/uuid** PHP · 12,642 stars A PHP library for generating universally unique identifiers (UUIDs).](https://vulcode.com/en/opensource/contributions/ramsey-uuid)

## Describe your project.

A free quote comes back within an hour during working hours.

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)
