[PR #11065] AbstractSqlExecutor::__sleep should return property names #12790

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

Original Pull Request: https://github.com/doctrine/orm/pull/11065

State: closed
Merged: Yes


From php.net:

If an object is converted to an array, the result is an array whose elements are the object's properties. The keys are the member variable names, with a few notable exceptions: integer properties are unaccessible; private variables have the class name prepended to the variable name; protected variables have a '*' prepended to the variable name. These prepended values have NUL bytes on either side. Uninitialized typed properties are silently discarded.

serialize supports the prepended property names, but this is undocumented. VarExporter does not support prepended property names. The PhpFilesAdapter uses VarExporter to create a php cache file. To prevent issues, we need to return the property names without the prefixes added by php when casting an object to an array.

Fixes #11063

**Original Pull Request:** https://github.com/doctrine/orm/pull/11065 **State:** closed **Merged:** Yes --- From php.net: > If an object is converted to an array, the result is an array whose elements are the object's properties. The keys are the member variable names, with a few notable exceptions: integer properties are unaccessible; private variables have the class name prepended to the variable name; protected variables have a '*' prepended to the variable name. These prepended values have NUL bytes on either side. Uninitialized [typed properties](https://www.php.net/manual/en/language.oop5.properties.php#language.oop5.properties.typed-properties) are silently discarded. `serialize` supports the prepended property names, but this is undocumented. `VarExporter` does not support prepended property names. The `PhpFilesAdapter` uses `VarExporter` to create a php cache file. To prevent issues, we need to return the property names without the prefixes added by php when casting an object to an array. Fixes #11063
admin added the pull-request label 2026-01-22 16:15:10 +01:00
admin closed this issue 2026-01-22 16:15:11 +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#12790