Bug #77119 [Com]: array_column has changed behaviour for classes
| From: | cravciucandy at gmail dot com | Date: | Fri, 01 Feb 2019 14:26:12 +0000 |
| Subject: | Bug #77119 [Com]: array_column has changed behaviour for classes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219326@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77119&edit=1
ID: 77119
Comment by: cravciucandy at gmail dot com
Reported by: josh at engramdesign dot com dot au
Summary: array_column has changed behaviour for classes
Status: Not a bug
Type: Bug
Package: Arrays related
Operating System: Centos
PHP Version: 7.0.32
Block user comment: N
Private report: N
New Comment:
The same problems are in PHP 7.0.33 built: Dec 11 2018 06:07:07
Previous Comments:
------------------------------------------------------------------------
[2018-11-08 04:41:37] requinix@php.net
It's working for me...
------------------------------------------------------------------------
[2018-11-08 03:15:54] josh at engramdesign dot com dot au
Well, I'm an idiot. The expected and actual results are around the wrong way. So sorry about
that. I can't see anywhere to edit my original post either (sorry, not used to this bug
tracker).
So what its returning is an empty array when it shouldn't be.
Does that make more sense now?
------------------------------------------------------------------------
[2018-11-08 03:09:38] requinix@php.net
Your expected behavior is incorrect. What the function is doing, and as you pointed out has been
doing since 7.0.0, it was it should be doing: returning an array with the "name"
properties extracted from the array of objects that was passed as the first argument.
------------------------------------------------------------------------
[2018-11-08 02:32:29] josh at engramdesign dot com dot au
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.
------------------------------------------------------------------------
[2018-11-08 02:14:29] peehaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
In specific check the documentation of the function you are using including the possible changelog
http://php.net/manual/en/function.array-column.php#refsect1-function.array-column-changelog
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=77119
--
Edit this bug report at https://bugs.php.net/bug.php?id=77119&edit=1