- Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.30
- Parse error: syntax error, unexpected '}' in /in/PTCUE on line 18
Process exited with code 255.
<?php
$categories = array('Movie');
$reviews = array(
array('category' => 'Movie'),
array('category' => 'Movie'),
array('category' => 'Movie'),
array('category' => 'Movie'),
array('category' => 'Game')
);
print_r($reviews);
// The issue WAS I'm not use ($categories) here...
$filtered = array_filter($reviews, function($review) {
return in_array($review['category'], $categories) === NULL
});
print_r($filtered);