doc-en icon indicating copy to clipboard operation
doc-en copied to clipboard

Improve documentation by renaming needle and haystack arguments

Open fluminis opened this issue 6 months ago • 1 comments

Affected page

https://www.php.net/manual/en/function.str-contains.php https://www.php.net/manual/en/function.strpos.php https://www.php.net/manual/en/function.in-array.php ...

Current issue

In the PHP documentation, many string and array-related functions use the argument names needle and haystack. While this metaphor may be familiar to native English speakers, it can be confusing for non-native speakers or beginners.

Suggested improvement

Renaming these arguments to something more descriptive — such as searchString and targetText, or substring and fullString — would make the documentation clearer and more accessible. Improving clarity in naming could greatly help learners understand function behavior without having to interpret idiomatic expressions.

fluminis avatar Jul 04 '25 08:07 fluminis