1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 01:32:22 +01:00

Adding tests for the negative results of array_column()

This commit is contained in:
Ben Ramsey
2012-04-13 23:43:04 -05:00
parent 9035a1ed24
commit a811e5b6f7

View File

@@ -82,6 +82,14 @@ $numericCols = array(
);
var_dump(array_column($numericCols, 1));
echo "\n*** Testing failure to find specified column ***\n";
var_dump(array_column($numericCols, 2));
var_dump(array_column($numericCols, 'foo'));
echo "\n*** Testing single dimensional array ***\n";
$singleDimension = array('foo', 'bar', 'baz');
var_dump(array_column($singleDimension, 1));
echo "Done\n";
?>
--EXPECTF--
@@ -135,4 +143,14 @@ array(3) {
[2]=>
string(3) "333"
}
*** Testing failure to find specified column ***
array(0) {
}
array(0) {
}
*** Testing single dimensional array ***
array(0) {
}
Done