1--TEST--
2Test array_sum() function with objects castable to numeric type
3--EXTENSIONS--
4gmp
5--FILE--
6<?php
7$input = [gmp_init(25), gmp_init(6)];
8
9echo "array_sum() version:\n";
10var_dump(array_sum($input));
11
12echo "array_reduce() version:\n";
13var_dump(array_reduce($input, fn($carry, $value) => $carry + $value, 0));
14?>
15--EXPECT--
16array_sum() version:
17int(31)
18array_reduce() version:
19object(GMP)#5 (1) {
20  ["num"]=>
21  string(2) "31"
22}
23