Getting the following notice in PHP 7.4:
Notice: Only variables should be passed by reference
In:
$roots = array();
foreach ($data as $row) {
$row->type = end(explode(',',(implode(array_slice(explode ( ':', $row->global_id), -2, 1)))));
if ($row->parent_global_id === null) {
$roots[]= $row;
} else {
$data[$row->parent_global_id]->children[] = $row;
}
unset($row->parent_global_id);
unset($row->global_id);
}
at line:
$row->type = end(explode(',',(implode(array_slice(explode ( ':', $row->global_id), -2, 1)))));
I have seen other questions on this at SO, but can't quite figure out how to fix it in this instance. Ideas?