note 43969 added to language.control-structures

From: Date: Sat, 10 Jul 2004 12:13:35 +0000
Subject: note 43969 added to language.control-structures
Groups: php.notes 
Request: Send a blank email to php-notes+get-72984@lists.php.net to get a copy of this message
Yes, it's correct, that the order doesn't matter. But in the case of switching the parameters of comparison, mainly in complex expressions easy comprehensibility is no longer assured. <?php if(100 < $age) {} if($age > 100) {} // much easier to retrace // and even in possible problems of assignment if(MONDAY == $weekday) {} // is the following use obviously more understandable if($weekday == MONDAY) {} // even in simple examples - so imagine a more complicated one ?> I prefer to compare as shown in the documentation to keep the semantic understandability as easy as possible. ---- Manual Page -- http://www.php.net/manual/en/language.control-structures.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43969 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43969&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43969&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#72984) next »