Closed androa closed 6 years ago
Sorry it's taken almost a year to get back on this!
According to http://php.net/manual/en/arrayobject.offsetget.php, offsetGet
should return null
if the specified index doesn't exist, not false
. This mirrors the existing array behavior if you reference an undefined index:
$a = array();
$b = $a['foo'];
var_dump($b); // null
As soon as the change is made, I'll merge it. Can you make the modification, or do you want me to do it?
When using a non-existing array offset to get from the Row, array_search will return false. This will be typecasted into a int and offset 0 will be returned instead of the requested.
This fixes so if array_search() returns false, offsetGet() also returns false.
The existing testcases did not detect this bug since they used isset() for the non-existing keys, resulting in the usage of offsetExists(), not offsetGet().