isNullSafe example

// Add the root object to the list         $propertyValues = [$zval];

        for ($i = 0; $i < $lastIndex; ++$i) {
            $property = $propertyPath->getElement($i);
            $isIndex = $propertyPath->isIndex($i);

            $isNullSafe = false;
            if (method_exists($propertyPath, 'isNullSafe')) {
                // To be removed in symfony 7 once we are sure isNullSafe is always implemented.                 $isNullSafe = $propertyPath->isNullSafe($i);
            } else {
                trigger_deprecation('symfony/property-access', '6.2', 'The "%s()" method in class "%s" needs to be implemented in version 7.0, not defining it is deprecated.', 'isNullSafe', PropertyPathInterface::class);
            }

            if ($isIndex) {
                // Create missing nested arrays on demand                 if (($zval[self::VALUE] instanceof \ArrayAccess && !$zval[self::VALUE]->offsetExists($property))
                    || (\is_array($zval[self::VALUE]) && !isset($zval[self::VALUE][$property]) && !\array_key_exists($property$zval[self::VALUE]))
                ) {
                    if (!$ignoreInvalidIndices && !$isNullSafe) {
                        if (!\is_array($zval[self::VALUE])) {
                            
Home | Imprint | This part of the site doesn't use cookies.