3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $mlbCities = array( 'Carolina', 'Atlanta', 'New Orleans', 'Philadelphia', 'St. Louis', 'Washington', 'Houston', 'Tennessee', 'New England', 'NY Jets', 'Cincinnati', 'Green Bay', 'Arizona', 'Jacksonville', 'Oakland', 'Kansas City', 'Minnesota', 'Detroit', 'Tampa Bay', 'Buffalo', 'Seattle', 'San Francisco', 'Pittsburgh', 'Chicago', 'Baltimore', 'San Diego', 'Cleveland', 'Denver', 'NY Giants', 'Dallas', 'Indianapolis', 'Miami' ); $string = 'San Francisco Giants'; $fl_array = preg_grep($string, $mlbCities); var_dump($fl_array); ?>
Output for 4.3.11 - 7.2.0
Warning: preg_grep(): Delimiter must not be alphanumeric or backslash in /in/ikAFd on line 39 bool(false)
Output for 4.3.0 - 4.3.10
Warning: Delimiter must not be alphanumeric or backslash in /in/ikAFd on line 39 bool(false)