PHP 8.4 - ProxyFactory should skip private(set) properties #7487

Closed
opened 2026-01-22 15:52:14 +01:00 by admin · 0 comments
Owner

Originally created by @ngirardet-mob on GitHub (Mar 14, 2025).

Bug Report

Q A
Version 3.3.2
Previous Version if the bug is a regression N/A

Summary

The problem appears only since PHP8.4. Maybe this bug will be covered within issue : https://github.com/doctrine/orm/issues/11624

When an entity contains an association, if that association contains private(set) properties, the class ProxyFactory should skip those properties as if they where private.

Current behavior

ProxyFactory considers private(set) properties and pass them to the createLazyGhost for initialization and throws an error.
Error: Cannot unset private(set) property Doctrine\Tests\ORM\Functional\Ticket\SkipPrivateSetProperties\UserPrivateSetProperties::$company from scope Doctrine\Tests\Proxies\__CG__\Doctrine\Tests\ORM\Functional\Ticket\SkipPrivateSetProperties\UserPrivateSetProperties

Expected behavior

Private(set) properties should be ignore as if they where private.

How to reproduce

PR on the way

Originally created by @ngirardet-mob on GitHub (Mar 14, 2025). ### Bug Report | Q | A |-------------------------------------------- | ------ | Version | 3.3.2 | Previous Version if the bug is a regression | N/A #### Summary The problem appears only since PHP8.4. Maybe this bug will be covered within issue : https://github.com/doctrine/orm/issues/11624 When an entity contains an association, if that association contains private(set) properties, the class `ProxyFactory` should skip those properties as if they where `private`. #### Current behavior `ProxyFactory` considers private(set) properties and pass them to the `createLazyGhost` for initialization and throws an error. `Error: Cannot unset private(set) property Doctrine\Tests\ORM\Functional\Ticket\SkipPrivateSetProperties\UserPrivateSetProperties::$company from scope Doctrine\Tests\Proxies\__CG__\Doctrine\Tests\ORM\Functional\Ticket\SkipPrivateSetProperties\UserPrivateSetProperties` #### Expected behavior Private(set) properties should be ignore as if they where `private`. #### How to reproduce PR on the way
admin closed this issue 2026-01-22 15:52:15 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7487