Update Context.php

If the array contains the given key with a null value, the null value should be returned instead of an empty string.
This commit is contained in:
ulriklystbaek 2014-01-21 09:23:54 +01:00
parent 21b3bf9797
commit 4e2c869d3b

View File

@ -254,7 +254,7 @@ class Context
if (($inside !== '0' && empty($inside)) || ($inside == 'this')) {
return $variable;
} elseif (is_array($variable)) {
if (isset($variable[$inside])) {
if (isset($variable[$inside]) || array_key_exists($inside, $variable)) {
return $variable[$inside];
} elseif ($inside == "length") {
return count($variable);