On Thu, 17 Jun 2004 16:52:32 -0500, Michael Sims <[EMAIL PROTECTED]>
wrote:
ceil() returns a variable of type double. In the above script I
expected $foo to
become an empty array after calling unset(). But it seems that unset()
will not
remove an array element when you refer to its key using a double,
although isset()
will return true when referenced the same way. If I cast $b to either
an int or a
string, the unset call works. Am I just missing the portion of the
manual that
documents this behavior, or is this a bug? Just thought I'd see if
anyone had run
across this before...TIA
== does not check type in php. Hence, 2.0 == 2 == '2'. However, array
indexes are type specific, so $a[2] != $a['2']. Use === for type
specific checking, i.e.: echo 2 === '2'; will echo 0.
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php