1--TEST-- 2Test array_values() function (variation) 3--SKIPIF-- 4<?php 5if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); 6?> 7--INI-- 8precision=14 9--FILE-- 10<?php 11 12echo "\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); 18var_dump( array_values($arr_resource) ); 19 20echo "\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); 30var_dump( array_values($arr_range) ); 31 32echo "\n*** Testing array_values() on an array created on the fly ***\n"; 33var_dump( array_values(array(1,2,3)) ); 34var_dump( array_values(array()) ); // null array 35 36echo "Done\n"; 37?> 38--EXPECTF-- 39*** Testing array_values() with resource type *** 40array(2) { 41 [0]=> 42 resource(%d) of type (stream) 43 [1]=> 44 resource(%d) of type (stream) 45} 46 47*** Testing array_values() with range checking *** 48array(7) { 49 [0]=> 50 int(2147483647) 51 [1]=> 52 float(2147483648) 53 [2]=> 54 int(-2147483647) 55 [3]=> 56 float(-2147483648) 57 [4]=> 58 int(0) 59 [5]=> 60 int(0) 61 [6]=> 62 float(-2147483649) 63} 64 65*** Testing array_values() on an array created on the fly *** 66array(3) { 67 [0]=> 68 int(1) 69 [1]=> 70 int(2) 71 [2]=> 72 int(3) 73} 74array(0) { 75} 76Done 77