Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array functions #3008

Closed
robertoaceves opened this issue Dec 12, 2023 · 3 comments
Closed

Array functions #3008

robertoaceves opened this issue Dec 12, 2023 · 3 comments

Comments

@robertoaceves
Copy link

robertoaceves commented Dec 12, 2023

From manual page: https://php.net/ref.array

Hi. Is there a good reason to not include these functions:

on the Array Functions' Table of Contents.
It is difficult to find these functions and often it requires a web search and reading through several StackOverflow posts.

Thank you.

@Girgias
Copy link
Member

Girgias commented Dec 12, 2023

Because every single one of those functions are part of a different section of the manual. They might use or return arrays, but they are not predominantly about doing operations on arrays.

@Girgias Girgias closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2023
@robertoaceves
Copy link
Author

Thanks for your response.

I get that these functions are listed in other manual sections, but their purpose is to operate on arrays.

See, for example, the documentation for the next two functions makes explicit they work on arrays.

implode — Join array elements with a string
implode(string $separator, array $array): string

is_array — Finds whether a variable is an array
is_array(mixed $value): bool

It might be my lack of experience with PHP, but one would expect to find these functions in Array Functions' Table of Contents. The Introduction in the Arrays' chapter sets this expectation.

These functions allow you to interact with and manipulate arrays in various ways. Arrays are essential for storing, managing, and operating on sets of variables.

The purpose of this report is to improve the usability of the documentation, so I think it is worth to reconsider it and discuss it with a larger group of maintenance members.

Thanks.

@Girgias
Copy link
Member

Girgias commented Dec 15, 2023

Their purpose is not to operate on arrays, their purpose is to work on strings, or for is_array() meta-programming/reflections.

This is in stark contrast with functions such as sort(), array_map(), etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants