3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $URI_Parts = explode('/', $_SERVER['REQUEST_URI']); $URI_FirstSegment = $URI_Parts[0]; echo URI_FirstSegment;
Output for 7.2.0 - 7.3.0beta1
Notice: Undefined index: REQUEST_URI in /in/qsY0l on line 2 Warning: Use of undefined constant URI_FirstSegment - assumed 'URI_FirstSegment' (this will throw an Error in a future version of PHP) in /in/qsY0l on line 4 URI_FirstSegment
Output for 5.3.0 - 7.1.20
Notice: Undefined index: REQUEST_URI in /in/qsY0l on line 2 Notice: Use of undefined constant URI_FirstSegment - assumed 'URI_FirstSegment' in /in/qsY0l on line 4 URI_FirstSegment
Output for 4.3.0 - 5.2.17
Notice: Undefined index: REQUEST_URI in /in/qsY0l on line 2 Notice: Use of undefined constant URI_FirstSegment - assumed 'URI_FirstSegment' in /in/qsY0l on line 4 URI_FirstSegment