isset and unset behaviour
| From: | Curt Zirzow | Date: | Fri, 18 Jun 2004 16:24:47 +0000 |
| Subject: | isset and unset behaviour | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-10589@lists.php.net to get a copy of this message | ||
Given:
$a[2] = '1';
$k = (double)2;
echo isset($a[$k]);
unset($a[$k]);
echo isset($a[$k]);
echo " -> expect 1\n";
Results:
11 -> expect 1
Although a double value isn't a valid array index, it doesn't seem
to be consistent. I'm thinking that the code should yeild one of
two results:
1. Issue warning as with using objects or arrays as keys
2. unset uses the str.val to retrieve the proper index.
Any thoughts on the proper behaviour?
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!