TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
339 B
17 lines
339 B
--TEST--
|
|
Test array_product() function with empty array
|
|
--FILE--
|
|
<?php
|
|
$input = [];
|
|
|
|
echo "array_product() version:\n";
|
|
var_dump(array_product($input));
|
|
|
|
echo "array_reduce() version:\n";
|
|
var_dump(array_reduce($input, fn($carry, $value) => $carry * $value, 1));
|
|
?>
|
|
--EXPECT--
|
|
array_product() version:
|
|
int(1)
|
|
array_reduce() version:
|
|
int(1)
|
|
|