From 38d97557da2614f5fe1d0fa64f33dfb2cf6cbaad Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Tue, 24 Jul 2018 11:34:57 +0800 Subject: Fixed bug #68553 (array_column: null values in $index_key become incrementing keys in result) --- ext/standard/tests/array/bug68553.phpt | 66 ++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 ext/standard/tests/array/bug68553.phpt (limited to 'ext/standard/tests/array') diff --git a/ext/standard/tests/array/bug68553.phpt b/ext/standard/tests/array/bug68553.phpt new file mode 100644 index 0000000000..91c5b080a9 --- /dev/null +++ b/ext/standard/tests/array/bug68553.phpt @@ -0,0 +1,66 @@ +--TEST-- +Bug #68553 (array_column: null values in $index_key become incrementing keys in result) +--FILE-- + 10], + ['a' => 20], + ['a' => true], + ['a' => false], + ['a' => fopen(__FILE__, "r")], + ['a' => -5], + ['a' => 7.38], + ['a' => null, "test"], + ['a' => null], +]; + +var_dump(array_column($a, null, 'a')); +--EXPECTF-- +array(8) { + [10]=> + array(1) { + ["a"]=> + int(10) + } + [20]=> + array(1) { + ["a"]=> + int(20) + } + [1]=> + array(1) { + ["a"]=> + bool(true) + } + [0]=> + array(1) { + ["a"]=> + bool(false) + } + [%d]=> + array(1) { + ["a"]=> + resource(%d) of type (stream) + } + [-5]=> + array(1) { + ["a"]=> + int(-5) + } + [7]=> + array(1) { + ["a"]=> + float(7.38) + } + [""]=> + array(1) { + ["a"]=> + NULL + } +} -- cgit v1.2.1