DEV Community

Discussion on: Writing Clean Code

Collapse
 
mdor profile image
Marco Antonio Dominguez

At least for this example, is a good option use a single return statement, in case that we have more comparisons or complex ones would be better split on several statements.

The code is readable also I checked the code using these pages: phpcodechecker.com/ and piliapp.com/php-syntax-check/, it doesn't have issues.

Thread Thread
 
cyr1l profile image
cyr1l

Hi,
I did not find a php checker that indicates some bad practices in the code contrary to those of the javascript language (esprima.org/demo/validate.html, extendsclass.com/javascript-fiddle...).