3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arry = [ 'company' => [ 'salesChannel' => [ 'type' => '', ], ] ]; function walkR(&$arry, $value) { foreach ($arry as &$elem) { if (is_array($elem)) { walkR($elem, $value); } else { $elem = $value; } } } $value = function () { return 'I\'m from closure'; }; walkR($arry, $value); $vars = new ArrayObject($arry)->getArrayCopy(); extract($vars); $company['salesChannel']['type']();
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.29, 5.6.7 - 5.6.13
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/SrMeg on line 32
Process exited with code 255.

preferences:
178.9 ms | 1400 KiB | 63 Q