diff options
author | Sara Golemon <pollita@php.net> | 2013-04-21 22:21:40 -0700 |
---|---|---|
committer | Sara Golemon <pollita@php.net> | 2013-04-21 22:35:04 -0700 |
commit | 7b34324f846505a0af6bed83556b840b50a1ef30 (patch) | |
tree | a943531639b7042222bd99ae67945214aa7db42f /ext/standard/tests/array/array_column_basic.phpt | |
parent | b119836765a72700a07b004b95c92beffa3daf95 (diff) | |
download | php-git-7b34324f846505a0af6bed83556b840b50a1ef30.tar.gz |
Fix handling of double keys in array_column
Also fix resource test to not localize __FILE__ to cwd.
Diffstat (limited to 'ext/standard/tests/array/array_column_basic.phpt')
-rw-r--r-- | ext/standard/tests/array/array_column_basic.phpt | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/ext/standard/tests/array/array_column_basic.phpt b/ext/standard/tests/array/array_column_basic.phpt index 70ce2136b4..8c499107d9 100644 --- a/ext/standard/tests/array/array_column_basic.phpt +++ b/ext/standard/tests/array/array_column_basic.phpt @@ -42,8 +42,7 @@ echo "-- last_name column from recordset, keyed by value from first_name column var_dump(array_column($records, 'last_name', 'first_name')); echo "\n*** Testing multiple data types ***\n"; -$file = basename(__FILE__); -$fh = fopen($file, 'r', true); +$fh = fopen(__FILE__, 'r', true); $values = array( array( 'id' => 1, @@ -89,11 +88,13 @@ $numericCols = array( ); var_dump(array_column($numericCols, 1)); var_dump(array_column($numericCols, 1, 0)); +var_dump(array_column($numericCols, 1, 0.123)); echo "\n*** Testing failure to find specified column ***\n"; var_dump(array_column($numericCols, 2)); var_dump(array_column($numericCols, 'foo')); var_dump(array_column($numericCols, 0, 'foo')); +var_dump(array_column($numericCols, 3.14)); echo "\n*** Testing single dimensional array ***\n"; $singleDimension = array('foo', 'bar', 'baz'); @@ -230,6 +231,14 @@ array(3) { ["ccc"]=> string(3) "333" } +array(3) { + ["aaa"]=> + string(3) "111" + ["bbb"]=> + string(3) "222" + ["ccc"]=> + string(3) "333" +} *** Testing failure to find specified column *** array(0) { @@ -244,6 +253,8 @@ array(3) { [2]=> string(3) "ccc" } +array(0) { +} *** Testing single dimensional array *** array(0) { |