How to print argument value to error log?

The following is my function,

    protected function mergeMetadataElement(array $bundleComponents, $name, array $data, $reverseMerge = false)
    {
        if (isset($bundleComponents[$name])) {
            $bundleComponents[$name] = $reverseMerge
                ? array_replace_recursive($data, $bundleComponents[$name])
                : array_replace_recursive($bundleComponents[$name], $data);
            return [$bundleComponents, true];
        } else {
            foreach ($bundleComponents as &$childData) {
                if (isset($childData['attributes']['class'])
                    && is_a($childData['attributes']['class'], \Magento\Ui\Component\Container::class, true)
                    && isset($childData['children']) && is_array($childData['children'])
                ) {
                    list($childData['children'], $isMerged) = $this->mergeMetadataElement(
                        $childData['children'],
                        $name,
                        $data,
                        $reverseMerge
                    );
                    if ($isMerged) {
                        return [$bundleComponents, true];
                    }
                }
            }
        }
        return [$bundleComponents, false];
    }

the third argument $data return null, how to debug whether the data is getting or not?

Have you checked the PHP manual?

If you know it’s null, what is there to debug?

Sorry for asking a stupid question, i just want to debug, any idea pls.

Try this post:

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.