protected function readPropertyPath(&$objectOrArray, $currentIndex)
{
$property = $this->elements[$currentIndex];
if (is_object($objectOrArray)) {
$value = $this->readProperty($objectOrArray, $currentIndex);
}
// arrays need to be treated separately (due to PHP bug?)
// http://bugs.php.net/bug.php?id=52133
else {
if (!array_key_exists($property, $objectOrArray)) {
$objectOrArray[$property] = $currentIndex + 1 < $this->length ? array() : null;
}
$value =& $objectOrArray[$property];
}
++$currentIndex;
if ($currentIndex < $this->length) {
return $this->readPropertyPath($value, $currentIndex);
} else {
return $value;
}
}