3v4l.org

run code in 300+ PHP versions simultaneously
<?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'; foreach($mlbCities as $city) { $fl_array[] = preg_grep("/$city/", $string); } var_dump($fl_array); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: preg_grep(): Argument #2 ($array) must be of type array, string given in /in/6kRGF:40 Stack trace: #0 /in/6kRGF(40): preg_grep('/Carolina/', 'San Francisco G...') #1 {main} thrown in /in/6kRGF on line 40
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
39.57 ms | 401 KiB | 8 Q