3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function func($c, $d) { $result = array_search($d, $c); if (result !== false) { return $result; } } $c=[1,2,4,8,18,20,33,66,99]; echo func($c, 19);
based on DHQjn
Output for 7.2.0
Warning: Use of undefined constant result - assumed 'result' (this will throw an Error in a future version of PHP) in /in/M6Xmb on line 6
Output for 5.4.10 - 7.1.10
Notice: Use of undefined constant result - assumed 'result' in /in/M6Xmb on line 6
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/M6Xmb on line 11
Process exited with code 255.