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

Use '__DIR__' instead of 'dirname(__FILE__)' #817

Conversation

MekDrop
Copy link
Contributor

@MekDrop MekDrop commented Sep 25, 2022

This pull request brings fewer parentheses ;)

Smarty at the current moment needs at least PHP 7.1, so we can use __DIR__ instead of dirname(__FILE__). This makes the code a bit easier to read - fewer parentheses and also adds a micro-optimization for resolving directories - no function calls are needed because all paths resolving happens at compiling time.

It's not much but I hope this could be useful.

@wisskid wisskid merged commit 1b556c7 into smarty-php:master Sep 27, 2022
@MekDrop MekDrop deleted the improvement/dirname(__FILE__)-convert-into-__DIR__ branch September 27, 2022 10:39
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.

2 participants