1--TEST-- 2Test array_keys() function (error conditions) 3--FILE-- 4<?php 5 6echo "\n*** Testing error conditions ***"; 7var_dump(array_keys(100)); 8var_dump(array_keys("string")); 9var_dump(array_keys(new stdclass)); // object 10var_dump(array_keys()); // Zero arguments 11var_dump(array_keys(array(), "", TRUE, 100)); // args > expected 12var_dump(array_keys(array(1,2,3, new stdClass => array()))); // (W)illegal offset 13 14echo "Done\n"; 15?> 16--EXPECTF-- 17*** Testing error conditions *** 18Warning: array_keys() expects parameter 1 to be array, int given in %s on line %d 19NULL 20 21Warning: array_keys() expects parameter 1 to be array, string given in %s on line %d 22NULL 23 24Warning: array_keys() expects parameter 1 to be array, object given in %s on line %d 25NULL 26 27Warning: array_keys() expects at least 1 parameter, 0 given in %s on line %d 28NULL 29 30Warning: array_keys() expects at most 3 parameters, 4 given in %s on line %d 31NULL 32 33Warning: Illegal offset type in %s on line %d 34array(3) { 35 [0]=> 36 int(0) 37 [1]=> 38 int(1) 39 [2]=> 40 int(2) 41} 42Done 43