3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function check($expected, $estado) { foreach ((array) $estado as $estado) { if ($expected === $estado) { return 'true'; } } return 'false'; } echo check(1, 1), PHP_EOL; echo check(1, 2), PHP_EOL; echo check(1, array(1, 2)), PHP_EOL; echo check(1, array(2, 3)), PHP_EOL; echo check(1, array(3, 2, 1)), PHP_EOL;
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.1.0
true false true false true
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
true Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/AF0I9 on line 16 PHP_EOLfalse Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/AF0I9 on line 17 PHP_EOLtrue Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/AF0I9 on line 18 PHP_EOLfalse Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/AF0I9 on line 19 PHP_EOLtrue Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/AF0I9 on line 20 PHP_EOL