Annotation of embedaddon/php/ext/standard/tests/array/array_product_variation3.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test array_product() function : variation
3: --FILE--
4: <?php
5: /* Prototype : mixed array_product(array input)
6: * Description: Returns the product of the array entries
7: * Source code: ext/standard/array.c
8: * Alias to functions:
9: */
10:
11: echo "*** Testing array_product() : variations - negative numbers***\n";
12:
13: echo "\n-- Testing array_product() function with one negative number --\n";
14: var_dump( array_product(array(-2)) );
15:
16: echo "\n-- Testing array_product() function with two negative numbers --\n";
17: var_dump( array_product(array(-2, -3)) );
18:
19: echo "\n-- Testing array_product() function with three negative numbers --\n";
20: var_dump( array_product(array(-2, -3, -4)) );
21:
22: echo "\n-- Testing array_product() function with negative floats --\n";
23: var_dump( array_product(array(-1.5)));
24:
25: echo "\n-- Testing array_product() function with negative floats --\n";
26: var_dump( array_product(array(-99999999.9, 99999999.1)));
27:
28:
29: ?>
30: ===DONE===
31: --EXPECTF--
32: *** Testing array_product() : variations - negative numbers***
33:
34: -- Testing array_product() function with one negative number --
35: int(-2)
36:
37: -- Testing array_product() function with two negative numbers --
38: int(6)
39:
40: -- Testing array_product() function with three negative numbers --
41: int(-24)
42:
43: -- Testing array_product() function with negative floats --
44: float(-1.5)
45:
46: -- Testing array_product() function with negative floats --
47: float(-9.9999999E+15)
48: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>