★ wanayoo — archive 1999 https://github.com/splitbrain/php-cli/pull/16Nouvelle recherche | Portail wanayoo
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

Ensure php7.4 compatibility #16

Merged
merged 1 commit into from Dec 12, 2019
Merged

Ensure php7.4 compatibility #16

merged 1 commit into from Dec 12, 2019

Conversation

@usox
Copy link
Contributor

@usox usox commented Dec 10, 2019

Hi

Array and string offset access syntax with curly braces is deprecated in php 7.4 so I replaced it by strpos calls.
I also optimized the OptionTest a bit

Copy link
Owner

@splitbrain splitbrain left a comment

I believe, simply replacing the curly brackets with square brackets is faster than strpos. (I realize that this is a micro-optimization)

@usox
Copy link
Contributor Author

@usox usox commented Dec 11, 2019

Hi

I believe, simply replacing the curly brackets with square brackets is faster than strpos.

I think so, too - it was my first approach. But I guess there are many people out there who don't know about the array-like access to char positions in a string, so I chose strpos.
If you prefer the array-like access, I will change the PR accordingly.

@usox usox force-pushed the usox:php74-compat branch from 33857d0 to c018124 Dec 12, 2019
@usox
Copy link
Contributor Author

@usox usox commented Dec 12, 2019

Done

@splitbrain splitbrain merged commit fb4f888 into splitbrain:master Dec 12, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@splitbrain
Copy link
Owner

@splitbrain splitbrain commented Dec 12, 2019

thanks

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

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.