1--TEST--
2Test array_product() function : variation
3--FILE--
4<?php
5echo "*** Testing array_product() : variation - using non numeric values ***\n";
6
7class A {
8  static function help() { echo "hello\n"; }
9}
10
11$types = array("boolean (true)" => true, "boolean (false)" => false,
12       "string" => "hello", "numeric string" =>  "12",
13       "resource" => STDERR, "object" => new A(), "null" => null,
14       "array" => array(3,2));
15
16foreach ($types as $desc => $type) {
17  echo $desc, "\n";
18  var_dump(array_product([1, $type]));
19  echo "\n";
20}
21
22?>
23--EXPECTF--
24*** Testing array_product() : variation - using non numeric values ***
25boolean (true)
26int(1)
27
28boolean (false)
29int(0)
30
31string
32
33Warning: array_product(): Multiplication is not supported on type string in %s on line %d
34int(0)
35
36numeric string
37int(12)
38
39resource
40
41Warning: array_product(): Multiplication is not supported on type resource in %s on line %d
42int(3)
43
44object
45
46Warning: array_product(): Multiplication is not supported on type A in %s on line %d
47int(1)
48
49null
50int(0)
51
52array
53
54Warning: array_product(): Multiplication is not supported on type array in %s on line %d
55int(1)
56
57