3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //because Safari wont play ball $allowedBrowsers = array("Chrome", "Firefox"); $browser = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"; if (strpos($browser, $allowedBrowsers) !== FALSE) { echo "no safari"; } else { echo "using safari"; } //$browser = get_browser(null, true); //print_r($browser); ?>
Output for 5.3.1 - 7.2.0
Warning: strpos(): needle is not a string or an integer in /in/da3gd on line 4 using safari
Output for 4.3.0 - 5.3.0
using safari