preg_match_all $flags default value is unclear
Nobody has claimed this yet.
- Dominant language
- XML
- Stars
- 596
- Forks
- 890
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 55
Description
From manual page: https://php.net/function.preg-match-all
Hi, just a small thing, the Description section says that int $flags = 0,, but the Parameters section describing flags says at the end that:
If no order flag is given,
PREG_PATTERN_ORDERis assumed.
The numeric value of PREG_PATTERN_ORDER is 1, the source says $flags = 0 at
https://github.com/php/php-src/blob/master/ext/pcre/php_pcre.stub.php#L105
function preg_match_all(string $pattern, string $subject, &$matches = null, int $flags = 0, int $offset = 0): int|false {}
Maybe they could be made consistent, even lying a bit in the docs by saying $flags = PREG_PATTERN_ORDER?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare the preg_match_all manual page's Description and Parameters sections with the referenced ext/pcre/php_pcre.stub.php definition. Decide on wording that clearly explains the default flags behavior, update the documentation, and verify that the signature and parameter description are consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100