summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array
diff options
context:
space:
mode:
authorSara Golemon <pollita@php.net>2013-04-22 14:57:05 -0700
committerSara Golemon <pollita@php.net>2013-04-22 15:54:21 -0700
commit1a03bd5dee97a0f8b9e74b7f8db5231abd8cc7e4 (patch)
treeeaf61baa165de87eb0b25db7714e9eeccb834eac /ext/standard/tests/array
parentf63db963c48775e89e7d5f63235733098c2f653d (diff)
downloadphp-git-1a03bd5dee97a0f8b9e74b7f8db5231abd8cc7e4.tar.gz
Allow array_column() to take -1 as a valid value in third param
Also do some cleanup and simplification to make this code more readable in the long term.
Diffstat (limited to 'ext/standard/tests/array')
-rw-r--r--ext/standard/tests/array/array_column_basic.phpt11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/standard/tests/array/array_column_basic.phpt b/ext/standard/tests/array/array_column_basic.phpt
index eb267dad73..7c30cdfd10 100644
--- a/ext/standard/tests/array/array_column_basic.phpt
+++ b/ext/standard/tests/array/array_column_basic.phpt
@@ -84,11 +84,12 @@ echo "\n*** Testing numeric column keys ***\n";
$numericCols = array(
array('aaa', '111'),
array('bbb', '222'),
- array('ccc', '333')
+ array('ccc', '333', -1 => 'ddd')
);
var_dump(array_column($numericCols, 1));
var_dump(array_column($numericCols, 1, 0));
var_dump(array_column($numericCols, 1, 0.123));
+var_dump(array_column($numericCols, 1, -1));
echo "\n*** Testing failure to find specified column ***\n";
var_dump(array_column($numericCols, 2));
@@ -239,6 +240,14 @@ array(3) {
["ccc"]=>
string(3) "333"
}
+array(3) {
+ [0]=>
+ string(3) "111"
+ [1]=>
+ string(3) "222"
+ ["ddd"]=>
+ string(3) "333"
+}
*** Testing failure to find specified column ***
array(0) {