3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $parts=explode('.', foo.example.com); if(isset($parts[2]) && !empty($parts[2])) { switch($parts[2]) { case 'nl': echo "404"; break; } }
based on 4TKNT
Output for 7.2.0
Warning: Use of undefined constant foo - assumed 'foo' (this will throw an Error in a future version of PHP) in /in/RmPT0 on line 3 Warning: Use of undefined constant example - assumed 'example' (this will throw an Error in a future version of PHP) in /in/RmPT0 on line 3 Warning: Use of undefined constant com - assumed 'com' (this will throw an Error in a future version of PHP) in /in/RmPT0 on line 3
Output for 5.3.22 - 7.1.10
Notice: Use of undefined constant foo - assumed 'foo' in /in/RmPT0 on line 3 Notice: Use of undefined constant example - assumed 'example' in /in/RmPT0 on line 3 Notice: Use of undefined constant com - assumed 'com' in /in/RmPT0 on line 3