Simply with `!empty($children[$item['path']])`?