Symfony\Component\PropertyAccess\PropertyAccessor::writeIndex PHP Метод

writeIndex() приватный Метод

Sets the value of an index in a given array-accessible value.
private writeIndex ( array $zval, string | integer $index, mixed $value )
$zval array The array containing the array or \ArrayAccess object to write to
$index string | integer The index to write at
$value mixed The value to write
    private function writeIndex($zval, $index, $value)
    {
        if (!$zval[self::VALUE] instanceof \ArrayAccess && !is_array($zval[self::VALUE])) {
            throw new NoSuchIndexException(sprintf('Cannot modify index "%s" in object of type "%s" because it doesn\'t implement \ArrayAccess', $index, get_class($zval[self::VALUE])));
        }

        $zval[self::REF][$index] = $value;
    }