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

[refactor] Use range() function instead of string increment #367

Merged
merged 1 commit into from Feb 23, 2023
Merged

[refactor] Use range() function instead of string increment #367

merged 1 commit into from Feb 23, 2023

Conversation

Girgias
Copy link
Contributor

@Girgias Girgias commented Feb 23, 2023

This was found during the analysis for https://wiki.php.net/rfc/saner-inc-dec-operators

I don't know what is the minimal version targeted, so the line which defines $c may need to be changes to use array_merge() CI is telling me it's PHP-5.6 so that's clear.

This was found during the analysis for https://wiki.php.net/rfc/saner-inc-dec-operators

I don't know what is the minimal version targeted, so the line which defines ``$c`` may need to be changes to use ``array_merge()``
@ezyang ezyang changed the title Use range() function instead of string increment [refactor] Use range() function instead of string increment Feb 23, 2023
$c = array_merge($l, $u, $d, $b);
// Concatenate all valid characters into a string
// Use '_- ' as an initial value
$this->mask = array_reduce($c, function ($carry, $value) {
Copy link
Owner

Choose a reason for hiding this comment

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

...really lol

@ezyang ezyang merged commit c05639e into ezyang:master Feb 23, 2023
@Girgias Girgias deleted the range-insteadof-string-inc branch February 24, 2023 14:06
@vlakoff
Copy link

vlakoff commented Oct 20, 2023

At the end, we could more simply do $this->mask = '_- ' . implode($c);

@pyres01
Copy link

pyres01 commented Oct 20, 2023 via email

Copy link

🎉 This PR is included in version 4.17.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

4 participants