|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-11-08 01:47 UTC] josh at engramdesign dot com dot au
Description:
------------
A recent update to 7.0.32 has caused this bug. Please refer to the reproducible example where an array of classes is supplied to `array_column`.
This worked fine in previous 7.0.x versions.
Test script:
---------------
$class = new \stdClass();
$class->name = 'Test';
var_dump($class);
$names = array_column([$class], 'name');
var_dump($names);
Expected result:
----------------
object(stdClass)#769 (1) { ["name"]=> string(4) "Test" }
array(0) { }
Actual result:
--------------
object(stdClass)#769 (1) { ["name"]=> string(4) "Test" }
array(1) { [0]=> string(4) "Test" }
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 08:00:01 2025 UTC |
Then why does the output for "Output for hhvm-3.17.3 - 3.22.0, 7.0.0 - 7.3.0rc4" show the following? object(stdClass)#1 (1) { ["name"]=> string(4) "Test" } array(1) { [0]=> string(4) "Test" } I will note that 3v4l doesn't have 7.0.32 available to test, and it works as expected in 7.0.31.