php / php/doc-en

`array_column()` should handle not-set column name

Open
#4,719 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Status: Needs Triage
Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

Description

repro: https://3v4l.org/o3IRK

man: https://www.php.net/manual/en/function.array-column.php

It seems almost like a bug, but I would expect at least warning when $column_key param is not found in every row.

Currently any row without the $column_key present are skipped without any warning.

Alternatively I null can be assumed instead.

If the original behaviour is preferred, I would like to have $strict param added which will require $column_key present in every row and $index_key too if set.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the array_column() manual page and compare its documented behavior with the provided 3v4l.org reproduction. Determine whether missing column keys need a documented warning, null result, or an explicitly specified strict option, then update the manual once the expected behavior is settled.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.