3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = 'a quick red fox jumped over the lazy brown dog'; $charFirst = substr($item, 0, 1); $charLast = substr($item, strlen($item) - 1, 1); echo $charFirst . PHP_EOL; echo $charLast . PHP_EOL;
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: item in /in/mkOlP on line 4 Notice: Undefined variable: item in /in/mkOlP on line 5 Notice: Undefined variable: item in /in/mkOlP on line 5
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.0.3
Notice: Undefined variable: item in /in/mkOlP on line 4 Notice: Undefined variable: item in /in/mkOlP on line 5 Notice: Undefined variable: item in /in/mkOlP on line 5
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Undefined variable: item in /in/mkOlP on line 4 Notice: Undefined variable: item in /in/mkOlP on line 5 Notice: Undefined variable: item in /in/mkOlP on line 5 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mkOlP on line 7 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mkOlP on line 8 PHP_EOL