note 90085 added to language.types.string

From: Date: Sun, 05 Apr 2009 19:15:46 +0000
Subject: note 90085 added to language.types.string
Groups: php.notes 
Request: Send a blank email to php-notes+get-152839@lists.php.net to get a copy of this message
In response to Jarobman What you are experiencing isn't a bug, but it is an error. Those unquoted strings are being interpreted as undefined constants. From the documentation: If you use an undefined constant, PHP assumes that you mean the name of the constant itself, just as if you called it as a string (CONSTANT vs "CONSTANT"). An error of level E_NOTICE will be issued when this happens. See also the manual entry on why $foo[bar] is wrong (unless you first define() bar as a constant). If you simply want to check if a constant is set, use the defined() function. http://us2.php.net/manual/en/language.constants.syntax.php Hope that helps! ---- Server IP: 64.71.164.2 Probable Submitter: 71.111.122.157 ---- Manual Page -- http://www.php.net/manual/en/language.types.string.php Edit -- https://master.php.net/note/edit/90085 Del: integrated -- https://master.php.net/note/delete/90085/integrated Del: useless -- https://master.php.net/note/delete/90085/useless Del: bad code -- https://master.php.net/note/delete/90085/bad+code Del: spam -- https://master.php.net/note/delete/90085/spam Del: non-english -- https://master.php.net/note/delete/90085/non-english Del: in docs -- https://master.php.net/note/delete/90085/in+docs Del: other reasons-- https://master.php.net/note/delete/90085 Reject -- https://master.php.net/note/reject/90085 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#152839) next »