PHP: Conditionals Coding Style

Just to continue with PHP coding style, let me suggest a conditional statement coding standard. Just don’t use large three operands conditions like that:

condition ? if_true : if_false

If it’s too long it will be difficult to read and maintain. Better is:

(condition)
	? (if_true)
	: (if_false);

Leave a Reply

Your email address will not be published. Required fields are marked *