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 - 7.1.0
Notice: Undefined variable: f in /in/CRLqD on line 6 Warning: array_sum() expects parameter 1 to be array, null given in /in/CRLqD on line 6 I
Output for 5.0.4 - 5.2.17
Notice: Undefined variable: f in /in/CRLqD on line 6 Warning: array_sum(): The argument should be an array in /in/CRLqD on line 6 I
Output for 4.3.2 - 5.0.3
Notice: Undefined variable: f in /in/CRLqD on line 6 Warning: array_sum(): The argument should be an array in /in/CRLqD on line 6 I
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: f in /in/CRLqD on line 6 Warning: array_sum() [http://www.php.net/function.array-sum]: The argument should be an array in /in/CRLqD on line 6 I