You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It uses "isset()" instead of "array_key_exists" - and therefore falsely believes there is no property in the array - as isset() returns true on null values.
The text was updated successfully, but these errors were encountered:
msumme
changed the title
Property Path terminating in null throws exception
PropertyAccessor - valid propertypath for array access with null value to be returned throws exception
Nov 14, 2014
…kkooi)
This PR was merged into the 2.3 branch.
Discussion
----------
[PropertyAccessor] Allow null value for a array (2.3)
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #12482
| License | MIT
| Doc PR | -
Original PR is #12511
A rebase on 2.3 was requested by @fabpot
Commits
-------
9706b09 [PropertyAccessor] Added test to allow null value for a array
This is in version 2.5.
I have an array like the following:
If I call it throws an exception instead of returning null
This is because line 232:
https://github.com/symfony/symfony/blob/2.5/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L232
It uses "isset()" instead of "array_key_exists" - and therefore falsely believes there is no property in the array - as isset() returns true on null values.
The text was updated successfully, but these errors were encountered: