I'm trying to add element in an array dynamically.
Here's my code:
$tasks = [];
$task = [
'title' => 'task title',
'description' => 'task description'
];
array_push($tasks, $task);
When I'm doing that task is added in an array, but when I copy task variable and change its content I expect to update an array, instead previously added task is replaced.