IDE: Netbean
<?php
/**
* Sum function
* @author huypv
* @param int $first
* @param int $second
* @param int $next Optional
* @return int Sum of all params
*/
function sum($first, $second) {
$ret = $first + $second;
for($i = 2 ; $i < func_num_args(); $i++) {
$ret += func_get_arg($i);
}
return $ret;
}
echo sum(1, 2, 3);