note 57689 added to function.constant

From: Date: Tue, 11 Oct 2005 14:20:21 +0000
Subject: note 57689 added to function.constant
Groups: php.notes 
Request: Send a blank email to php-notes+get-96831@lists.php.net to get a copy of this message
In reply to VGR_experts_exchange at edainworks dot com To check if a constant is boolean, use this instead: <?php if (TRACE === true) {} ?> Much quicker and cleaner than using defined() and constant() to check for a simple boolean. IMO, using ($var === true) or ($var === false) instead of ($var) or (!$var) is the best way to check for booleans no matter what. Leaves no chance of ambiguity. ---- Manual Page -- http://www.php.net/manual/en/function.constant.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57689 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57689&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57689&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57689&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57689&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57689&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57689&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57689&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57689&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#96831) next »