LeetCode icon indicating copy to clipboard operation
LeetCode copied to clipboard

Use types and elseif

Open still-dreaming-1 opened this issue 2 years ago • 0 comments

Using type declarations (especially in conjunction with strict_types) can result in faster code, and is considered best practice in modern php code.

Php has an explicit elseif you can/should use instead of combining else with if. This is required by the PSR-12 coding standard, which is the most up to date version (used to be PSR-2) of the standard that is the closest thing there is to a standard accepted by the community of php programmers.

still-dreaming-1 avatar Oct 31 '23 23:10 still-dreaming-1