|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-02-25 08:07 UTC] laruence@php.net
[2016-02-25 08:07 UTC] laruence@php.net
-Status: Open
+Status: Closed
[2016-07-20 11:33 UTC] davey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
Description: ------------ If you do a foreach by reference on an array, array_column will ignore the third parameter Test script: --------------- <?php $arr = array('id' => 12345, 'name' => 'sam'); foreach ($arr as &$v) { $v = $v; } $arr = [$arr]; var_dump(array_column($arr, 'name', 'id')); Expected result: ---------------- array(1) { [12345]=> string(3) "sam" } Actual result: -------------- array(1) { [0]=> &string(3) "sam" }