Annotation of embedaddon/php/ext/standard/tests/array/array_values_variation_64bit.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test array_values() function
3: --SKIPIF--
4: <?php
5: if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
6: ?>
7: --INI--
8: precision=14
9: --FILE--
10: <?php
11:
12: echo "\n*** Testing array_values() with resource type ***\n";
13: $resource1 = fopen(__FILE__, "r"); // Creating a file resource
14: $resource2 = opendir("."); // Creating a dir resource
15:
16: /* creating an array with resources as elements */
17: $arr_resource = array( "a" => $resource1, "b" => $resource2);
18: var_dump( array_values($arr_resource) );
19:
20: echo "\n*** Testing array_values() with range checking ***\n";
21: $arr_range = array(
22: 2147483647,
23: 2147483648,
24: -2147483647,
25: -2147483648,
26: -0,
27: 0,
28: -2147483649
29: );
30: var_dump( array_values($arr_range) );
31:
32: echo "\n*** Testing array_values() on an array created on the fly ***\n";
33: var_dump( array_values(array(1,2,3)) );
34: var_dump( array_values(array()) ); // null array
35:
36: ?>
37: --EXPECTF--
38: *** Testing array_values() with resource type ***
39: array(2) {
40: [0]=>
41: resource(%d) of type (stream)
42: [1]=>
43: resource(%d) of type (stream)
44: }
45:
46: *** Testing array_values() with range checking ***
47: array(7) {
48: [0]=>
49: int(2147483647)
50: [1]=>
51: int(2147483648)
52: [2]=>
53: int(-2147483647)
54: [3]=>
55: int(-2147483648)
56: [4]=>
57: int(0)
58: [5]=>
59: int(0)
60: [6]=>
61: int(-2147483649)
62: }
63:
64: *** Testing array_values() on an array created on the fly ***
65: array(3) {
66: [0]=>
67: int(1)
68: [1]=>
69: int(2)
70: [2]=>
71: int(3)
72: }
73: array(0) {
74: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>