3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function x($n){ for($i=1;$i<$n;$i++){ !$n%$i ? $f[]=$i:0; } echo array_sum(@$f)==$n?"P":"I"; } x(28);
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: array_sum() expects parameter 1 to be array, null given in /in/RDTfu on line 6 I
Output for hhvm-3.10.0 - 3.12.0
Warning: Invalid operand type was used: array_sum expects an array or collection as argument 1 in /in/RDTfu on line 6 I
Output for 4.3.2 - 5.2.17
Warning: array_sum(): The argument should be an array in /in/RDTfu on line 6 I
Output for 4.3.0 - 4.3.1
Warning: array_sum() [http://www.php.net/function.array-sum]: The argument should be an array in /in/RDTfu on line 6 I