-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
Value:
[
'orders' => [
['price' => 0.0],
['price' => 1.0],
['price' => 2.0]
]
]
Expression: orders[?price].price
Expected result (result in the Javascript version of JMESPath) :
[0.0, 1.0, 2.0]
Actual result:
[1.0, 2.0]
The cause is in Utils.php, there are special cases for 0 and '0' but not for 0.0.
public static function isTruthy($value)
{
if (!$value) {
return $value === 0 || $value === '0';
} elseif ($value instanceof \stdClass) {
return (bool) get_object_vars($value);
} else {
return true;
}
}
Metadata
Metadata
Assignees
Labels
No labels