using quotes is what the parser expects. if you don't use quotes, it will take the index as a constant. if tehre's no contant with the same name, it THEN assumes its a string with value (name of constant), and emits an error of level E_NOTICE, which unfortunately is not displayed by default. the one place this is not true is inside double-quoted strings, where you should leave off the quote on the indeces UNLESS you use the curly brace syntax for complex variables inside quotes.
<?php
//right:
$str = $_SERVER['PHP_SELF'];//no doublequotes, use quoted indices
$str = "$_SERVER[PHP_SELF]"; //doublequotes, so non-quoted indices
$str = "{$_SERVER['PHP_SELF']}"; //doublequotes, but with curly braces, so quoted-inices
//wrong:
$str = $_SERVER[PHP_SELF]; //undefinded constant
$str = "$_SERVER['PHP_SELF']" //parser throws an error here, because you've got quoted indices without braces. wierd but true.
$str = "{$_SERVER[PHP_SELF]}" //undefined constant error
?>
see [man]types.string[/man] at the manual for more info, but i think my explanation will tell you what you need to know.