#66473Cannot create object implementing Serializable on PHP 5.6
Description
Starting with PHP 5.6 classes implementing the Serializable interface are represented as C instead of O in the serialized output.
The Container::getEmptyObject method which creates objects with the unserialize hack to avoid calling the constructor thus yields an error like this:
> Warning: Erroneous data format for unserializing ‘Foo’ in …
> Notice: unserialize(): Error at offset 13 of 15 bytes in …
Starting with PHP 5.4 this usecase can be dealt with by @ReflectionClass::newInstanceWithoutConstructor@
This also needs to fixed for TYPO3 6.2 though which supports PHP 5.3, in which case checking for the Serializable interface and using C instead of O could work.
Reviews 11
- TYPO3_6-2 45186[TASK] travis-ci: PHP 5.6 not allowed_failure anymore
- TYPO3_6-2 40522[BUGFIX] Fix serializable object creation with PHP 5.6
- TYPO3_6-2 40056[BUGFIX] Call initializeObject() after instantiating empty objects
- main 40245[TASK] Deprecate AbstractDomainObject::__wakeup and document changes
- main 40213[FOLLOWUP][TASK] Document DI happening before initializeObject()
- main 40195[TASK] Document DI happening before initializeObject()
- TYPO3_6-2 40163[TASK] Nail down php 5.6 instantiation issues in tests
- main 39914[BUGFIX] Call initializeObject() after instantiating empty objects
- TYPO3_6-2 39392[BUGFIX] Fix serializable object creation with PHP 5.6
- main 38765[BUGFIX] Fix serializable object creation with PHP 5.6
- TYPO3_6-2 39377[BUGFIX] Fix serializable object creation with PHP 5.6
Related issues 7
- Bug #66468TYPO3 6.2 will live longer than PHP 5.5 but is not compatible with PHP 5.6
- Bug #66482Extbase persistence layer fails to create empty objects in PHP 5.6.
- Task #66911Travis: Verify no git submodule exists
- Bug #67272initializeObject() not called for Extbase Domain Model
- Bug #67402Document "__wakeup" no longer called in AbstractDomainObjects as breaking (?)
- Bug #67408Nail down php 5.6 instantiation issues in tests
- Task #72112 travis-ci: PHP 5.6 not allowed_failure anymore