$a = [1, 2, 3];
$b = $a;
$b[] = 4;
echo count($a);What does this code print?
- a3✓
- b4
- c7
- dNotice: array modified after copy
Explanation:PHP arrays are value types copied on assignment: $b becomes an independent copy of $a. Appending 4 to $b does not change $a, so count($a) stays 3. No notice or error is raised for this.