3v4l.org

run code in 300+ PHP versions simultaneously
<?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);
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.

preferences:
192.04 ms | 1399 KiB | 67 Q