Re: $request problem
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: $request problem

From: Richard Levasseur <richardlev@gmail.com>
Date: Sun Mar 12 2006 - 22:30:15 CET

define('key', 'foobar', false);
$a = array('key'=>'value');
echo "$a[key]<br>";
echo "{$a[key]}<br>";
echo "{$a['key']}<br>";

output:
value
Errno: 8, Undefined index: foobar
value

It would seem constants are only expanded if they're in {}, and are
treated like strings otherwise. I wonder when this was changed, or if
its unintentional?
Received on Mon May 1 02:32:01 2006