PHP - Array Functions
Identify the error in this PHP code snippet:
$arr = [1, 2, 3, 4];
$filtered = array_filter($arr, function($n) {
if ($n % 2 == 0) {
return true;
}
});