Skip to content

Conversation

@joanhey
Copy link
Contributor

@joanhey joanhey commented Nov 9, 2024

Use Null coalescing assignment operator (PHP 7.4)

First check if $logFile !== '/dev/null' and later check if is_file(), so we use one stat less if not necessary and it's faster.

PD: perhaps it's better if the default is $logFile = '/dev/null'

EDIT: I see that you changed ??= to empty() in Commit 43f9aad
Initially I only wanted to change the if validation, and later changed to ??= that by default are always null, but you had change it for something.

Use Null coalescing assignment operator (PHP 7.4)

First check if logFile is 'dev/null' and later check if is_file(), so we use one stat less if not necessary.
@walkor walkor merged commit f7ce415 into walkor:master Nov 10, 2024
@joanhey joanhey deleted the patch-1 branch November 10, 2024 08:51
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