3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function isPerfect($n) { return $n[0]*$n[1]*$n[2]*$n[3]+1; } var_dump(isPerfect(['a','b','c','d']));
based on Rff4S
Output for 7.1.0 - 7.2.0
Warning: A non-numeric value encountered in /in/tIm0A on line 4 Warning: A non-numeric value encountered in /in/tIm0A on line 4 Warning: A non-numeric value encountered in /in/tIm0A on line 4 Warning: A non-numeric value encountered in /in/tIm0A on line 4 int(1)
Output for 5.4.2 - 7.0.20
int(1)
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/tIm0A on line 7
Process exited with code 255.