Closed sogerc1 closed 1 year ago
My code is:
$menu = []; $recurse = function ($parent, $path) use (&$recurse, &$menu, $res) { foreach ($res as $v) { if ($v['parent'] == $parent) { $name = "$path/{$v['name']}"; $menu[$v['id']] = $name; $recurse($v['id'], $name); } } }; // this semicolon should not be removed $recurse(0, '');
After formatting the code my semicolon marked with the comment is removed. However if I change the $name assignment to:
$name = $path.'/'.$v['name'];
then the semicolon is preserved.
My code is:
After formatting the code my semicolon marked with the comment is removed. However if I change the $name assignment to:
then the semicolon is preserved.