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'; foreach($mlbCities as $city) { var_dump($city); $team = strpos($string, $city); if (!empty($team)) { echo 'Found it\r'; exit; } else { echo "Nope\r"; } } ?>
Output for 4.3.0 - 7.2.0
string(8) "Carolina" Nope string(7) "Atlanta" Nope string(11) "New Orleans" Nope string(12) "Philadelphia" Nope string(9) "St. Louis" Nope string(10) "Washington" Nope string(7) "Houston" Nope string(9) "Tennessee" Nope string(11) "New England" Nope string(7) "NY Jets" Nope string(10) "Cincinnati" Nope string(9) "Green Bay" Nope string(7) "Arizona" Nope string(12) "Jacksonville" Nope string(7) "Oakland" Nope string(11) "Kansas City" Nope string(9) "Minnesota" Nope string(7) "Detroit" Nope string(9) "Tampa Bay" Nope string(7) "Buffalo" Nope string(7) "Seattle" Nope string(13) "San Francisco" Nope string(10) "Pittsburgh" Nope string(7) "Chicago" Nope string(9) "Baltimore" Nope string(9) "San Diego" Nope string(9) "Cleveland" Nope string(6) "Denver" Nope string(9) "NY Giants" Nope string(6) "Dallas" Nope string(12) "Indianapolis" Nope string(5) "Miami" Nope