array_sum()
function array_sum(array $array): int
Calculate the sum of values in an array.
Parameters:
$array(array)
Returns: int
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/array/array_sum.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how array_sum is implemented in the compiler, see the internals page.