I am getting the follow PHP notice as a result of testing migration to PHP 7.4:
Notice: Only variables should be passed by reference
On line:
$row->type = end(explode(",",(implode(array_slice(explode ( ':', $row->global_id), -2, 1)))));
This is 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);
}
How should that line be written for PHP 7?