$_POST[foo] and $_POST['foo'] both work because PHP will automatically upconvert single words of text that it doesn't know as a constant to a string.
That said, using $_POST[foo] is slower because not only does it cause notices to be thrown but it has to check for any definitions before it can assume that it is a string.
Sample:
<?php
$arr = array ();
for ( $x = 0; $x < 1000000; $x++ )
{
$arr [ foo ] = 'bar';
}
?>
Time of execution:
$ time php test.php
real 0m1.641s
user 0m1.424s
sys 0m0.044s
Versus:
<?php
$arr = array ();
for ( $x = 0; $x < 1000000; $x++ )
{
$arr [ 'foo' ] = 'bar';
}
?>
Run Time:
$ time php test.php
real 0m0.467s
user 0m0.292s
sys 0m0.052s
Yes, this is a highly exaggerated case but it is a decent example of how it is bad
~judda