note 52777 added to function.defined

From: Date: Thu, 12 May 2005 08:34:43 +0000
Subject: note 52777 added to function.defined
Groups: php.notes 
Request: Send a blank email to php-notes+get-89306@lists.php.net to get a copy of this message
To andreashaerter at plz_no_spam dot com "You *must* use defined() with quotes:" As noticed in the doc <?php //Example echos "constant not definded!" //Set error reporting error_reporting(E_ALL); //Define your constant define('constant', 'Test'); if (defined(constant)) //Returns NOTHING, NO false, NO true and NO notice { echo "constant definded!"; } else { echo "constant not definded!"; } ?> Of course ! Constant is replaced by 'Test' so you are testing if Test if defined wich is not the case It's the expected behavior.... ---- Manual Page -- http://www.php.net/manual/en/function.defined.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+52777 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52777&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52777&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52777&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52777&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52777&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+52777&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#89306) next »