Annotation of embedaddon/php/Zend/tests/bug62653.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #62653: unset($array[$float]) causes a crash
! 3: --FILE--
! 4: <?php
! 5: $array = array("5"=>"bar");
! 6: $foo = "10.0000"; // gettype($foo) = "string"
! 7: $foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double"
! 8: unset($array[$foo]);
! 9: print_r($array);
! 10:
! 11: $array = array("5"=>"bar");
! 12: $foo = "5";
! 13: unset($array[(float)$foo]);
! 14: print_r($array);
! 15:
! 16: $array = array("5"=>"bar");
! 17: $foo = "10.0000";
! 18: $foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double"
! 19: $name = "foo";
! 20: unset($array[$$name]);
! 21: print_r($array);
! 22:
! 23: ?>
! 24: --EXPECT--
! 25: Array
! 26: (
! 27: )
! 28: Array
! 29: (
! 30: )
! 31: Array
! 32: (
! 33: )
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>