3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function check($expected, $estado) { foreach ((array) $estado as $estado) { if ($expected === $tipo) { 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 5.5.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: tipo in /in/S1p79 on line 7 false Notice: Undefined variable: tipo in /in/S1p79 on line 7 false Notice: Undefined variable: tipo in /in/S1p79 on line 7 Notice: Undefined variable: tipo in /in/S1p79 on line 7 false Notice: Undefined variable: tipo in /in/S1p79 on line 7 Notice: Undefined variable: tipo in /in/S1p79 on line 7 false Notice: Undefined variable: tipo in /in/S1p79 on line 7 Notice: Undefined variable: tipo in /in/S1p79 on line 7 Notice: Undefined variable: tipo in /in/S1p79 on line 7 false
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.4.45
false false false false false
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
falsePHP_EOLfalsePHP_EOLfalsePHP_EOLfalsePHP_EOLfalsePHP_EOL