3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function GetLongestString() { var_dump(func_get_args()); } echo GetLongestString("a", "aaa", "aa") . PHP_EOL; echo GetLongestString("a", "bcd", "efgh", "") . PHP_EOL;
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(3) { [0]=> string(1) "a" [1]=> string(3) "aaa" [2]=> string(2) "aa" } array(4) { [0]=> string(1) "a" [1]=> string(3) "bcd" [2]=> string(4) "efgh" [3]=> string(0) "" }
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
array(3) { [0]=> string(1) "a" [1]=> string(3) "aaa" [2]=> string(2) "aa" } Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7f5pl on line 8 PHP_EOLarray(4) { [0]=> string(1) "a" [1]=> string(3) "bcd" [2]=> string(4) "efgh" [3]=> string(0) "" } Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7f5pl on line 9 PHP_EOL