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.
 
 

56 lines
1.1 KiB

--TEST--
Test array_product() function : variation
--FILE--
<?php
class A
{
static function help()
{
echo "hello\n";
}
}
function main()
{
echo "*** Testing array_product() : variation - using non numeric values ***\n";
$types = array("boolean (true)" => true, "boolean (false)" => false, "string" => "hello", "numeric string" => "12", "resource" => STDERR, "object" => new A(), "null" => null, "array" => array(3, 2));
foreach ($types as $desc => $type) {
echo $desc, "\n";
var_dump(array_product([1, $type]));
echo "\n";
}
}
?>
--EXPECTF--
*** Testing array_product() : variation - using non numeric values ***
boolean (true)
int(1)
boolean (false)
int(0)
string
Warning:%S Multiplication is not supported on type string in %s on line %d
int(0)
numeric string
int(12)
resource
Warning:%S Multiplication is not supported on type resource in %s on line %d
int(3)
object
Warning:%S Multiplication is not supported on type A in %s on line %d
int(1)
null
int(0)
array
Warning:%S Multiplication is not supported on type array in %s on line %d
int(1)