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.
24 lines
579 B
24 lines
579 B
--TEST--
|
|
Test array_product() function: resources in array
|
|
--FILE--
|
|
<?php
|
|
$input = [10, STDERR /* Should get casted to 3 as an integer */];
|
|
|
|
echo "array_product() version:\n";
|
|
var_dump(array_product($input));
|
|
|
|
echo "array_reduce() version:\n";
|
|
try {
|
|
var_dump(array_reduce($input, fn($carry, $value) => $carry * $value, 1));
|
|
} catch (TypeError $e) {
|
|
echo $e->getMessage();
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
array_product() version:
|
|
|
|
Warning:%S Multiplication is not supported on type resource in %s on line %d
|
|
int(30)
|
|
array_reduce() version:
|
|
Unsupported operand types: int * resource%S
|
|
%a
|
|
|