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

Switch from define() to the const keyword #23

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

stevegrunwell
Copy link
Owner

After rolling out version 2.0.1 last night and updating the version at the day job, @ChadSikorra and @ramsey pointed out that const not only plays nicer with IDEs but also has some slight performance improvements (const is defined at compile time, while define() happens at runtime). This is backed up by this StackOverflow answer from @nikic, so I'd say this is a good improvement for this library 😄

This PR replaces the define(__NAMESPACE__ . '\\CONSTANT_NAME') syntax with const CONSTANT_NAME for easy, micro-optimized wins all around!

@stevegrunwell stevegrunwell merged commit 7eb6bef into develop Aug 23, 2024
3 checks passed
@stevegrunwell stevegrunwell deleted the update/const-instead-of-define branch August 23, 2024 18:31
@stevegrunwell stevegrunwell mentioned this pull request Aug 23, 2024
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.

1 participant