Skip to content

Conversation

wouterj
Copy link
Contributor

@wouterj wouterj commented Oct 22, 2024

Using human readable words for the $characters parameter creates confusion, as each character is used separately in the function.

I propose to simplify the example by using one character when focusing on the standard behavior or the offset/length parameters. And modifying the example to use multiple consecutive characters instead of a real word (with duplicate characters).

Copy link
Member

@jimwins jimwins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also have an example where the $string does not contain any of the $characters?

Using human readable words for the `$characters` parameter creates
confusion, as each character is used separately in the function.
@wouterj wouterj force-pushed the strcspn-clarify-example branch from 74d9c95 to 7073c93 Compare October 23, 2024 09:25
@wouterj
Copy link
Contributor Author

wouterj commented Oct 23, 2024

Example added, as requested.

Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TimWolla TimWolla merged commit 89990d6 into php:master Oct 23, 2024
2 checks passed
@wouterj wouterj deleted the strcspn-clarify-example branch October 23, 2024 13:02
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

Successfully merging this pull request may close these issues.

3 participants