3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = "I am a boy"; $reversed = ""; $tmp = ""; for($i = 0; $i < strlen($string); $i++) { if($string[$i] == " ") { $reversed .= $tmp . " "; $tmp = ""; continue; } $tmp = $string[$i] . $tmp; echo $temp.PHP_EOL; } $reversed .= $tmp; echo $reversed;
Output for 5.0.4 - 7.2.0
Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Undefined variable: temp in /in/aMAIn on line 14 I ma a yob
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.0.3
Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Undefined variable: temp in /in/aMAIn on line 14 I ma a yob
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/aMAIn on line 14 PHP_EOL Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/aMAIn on line 14 PHP_EOL Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/aMAIn on line 14 PHP_EOL Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/aMAIn on line 14 PHP_EOL Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/aMAIn on line 14 PHP_EOL Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/aMAIn on line 14 PHP_EOL Notice: Undefined variable: temp in /in/aMAIn on line 14 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/aMAIn on line 14 PHP_EOLI ma a yob