Breaking: #66995 - ObjectAccess behaviors changed ¶
See Issue #66995
The following changes have been implemented in ObjectAccess:
- Uses more native PHP methods where reasonable
- Uses fewer method calls where reasonable
- Gets rid of a variables passed by reference
More cases return
nullrather than throw Exceptions
- Fastest decisions and access methods come first
- Reflection-based access isolated to edge cases and access with the “force direct access” flag enabled.
- Sacrifices ability to read objects of types other than persisted objects contained in an ObjectStorage or subclass of ObjectStorage.
Changes verdict from
truewhen determining if a dynamically added property exists on an object (these are by definition publicly accessible).
- Performance improvement; optimising for most frequent case coming first, skipping expensive Reflection etc.
- Reflection based access only happens when “force” flag is set to true in getProperty / getPropertyPath
- Removes support for using objects of types other than persisted objects in any ObjectStorage implementation.
- Changes behavior when accessing dynamically added properties on objects from previously false to now true (by definition they are public). This improves compatibility with JSON sources decoded to stdClass for example.
Affected Installations ¶
Any code using
ObjectStoragecombined with objects that are not persistent objects (Extbase models)
Any code passing
stdClasswith dynamic properties to
null(real value will now be returned)
If you have any
ObjectStorageimplementation containing other types than persisted objects, switch to any alternative (
If you have Extbase code or Fluid templates using
stdClassinstances with dynamically added properties and your code expects a false verdict for such properties (highly unlikely!) inverse any conditions depending on the resolved value being null or empty to expect the actual value of the value you address.