File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug62653.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:32:17 2013 UTC (11 years, 8 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

--TEST--
Bug #62653: unset($array[$float]) causes a crash
--FILE--
<?php
$array = array("5"=>"bar");
$foo = "10.0000"; // gettype($foo) = "string"
$foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double"
unset($array[$foo]);
print_r($array);

$array = array("5"=>"bar");
$foo = "5";
unset($array[(float)$foo]);
print_r($array);

$array = array("5"=>"bar");
$foo = "10.0000";
$foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double"
$name = "foo";
unset($array[$$name]);
print_r($array);

?>
--EXPECT--
Array
(
)
Array
(
)
Array
(
)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>