Skip to content

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

Merged
ezyang merged 1 commit intoezyang:masterfrom
Girgias:range-insteadof-string-inc
Feb 23, 2023
Merged

[refactor] Use range() function instead of string increment#367
ezyang merged 1 commit intoezyang:masterfrom
Girgias:range-insteadof-string-inc

Conversation

@Girgias
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

vlakoff commented Oct 20, 2023

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

@pyres01
Copy link
Copy Markdown

pyres01 commented Oct 20, 2023 via email

@github-actions
Copy link
Copy Markdown

🎉 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.

4 participants