PHP Bug or just a strange behaivor?
| From: | Marcus Hufvudsson | Date: | Wed, 09 Jul 2003 12:56:16 +0000 |
| Subject: | PHP Bug or just a strange behaivor? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-154540@lists.php.net to get a copy of this message | ||
Hi, Let's get right to it...
When I try to do this:
<?
echo $_COOKIE['test.1'];
?>
It doesn't work (needless to say there is a cookie that goes by this name)
So, when I did this:
<?
foreach($_COOKIE as $cook => $val) {
echo $val ." -> " .$cook ."<br>";
}
?>
I got:
ec1c9edd209143432f36fsd29af410ef27 -> test_1
Notice the _ (underscore) instead of . (dot)
So I though that you couldn't have dots in your array names... Just to be sure I wrote a small test program like this:
<?
$d['donald.1'] = "Donald duck";
echo $d['donald.1'];
?>
This however gave me the output:
Donald duck
# /usr/local/jail/apache/bin/php -v
PHP 4.3.1 (cli) (built: Apr 2 2003 11:25:25)
Copyright (c) 1997-2002 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies
So... anyone know what's up?
--
Marcus Hufvudsson
Artech administrator
Office: +46-500-427788
Email: admin@artech.se