summaryrefslogtreecommitdiff
path: root/Zend/tests/bug62653.phpt
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2012-07-26 13:52:42 +0800
committerXinchen Hui <laruence@php.net>2012-07-26 13:53:06 +0800
commiteae06100429f37e5297c432e99104daeeed13bad (patch)
tree10f7fa3906349966e56ccb9f20d755d4d33a16a9 /Zend/tests/bug62653.phpt
parentba27e0888a3bb91eba3266c71003df045c4d2091 (diff)
downloadphp-git-eae06100429f37e5297c432e99104daeeed13bad.tar.gz
Fixed bug #62653: (unset($array[$float]) causes a crash)
the reason why jpauli and I can not reproduce is (it's silly): I typo "USE_ZEND_ALLOC *&&* valgrind" at the first time, then I always ctrl+r and jpauli copied my command from the pastbin :) thanks
Diffstat (limited to 'Zend/tests/bug62653.phpt')
-rw-r--r--Zend/tests/bug62653.phpt33
1 files changed, 33 insertions, 0 deletions
diff --git a/Zend/tests/bug62653.phpt b/Zend/tests/bug62653.phpt
new file mode 100644
index 0000000000..cf5941c5b5
--- /dev/null
+++ b/Zend/tests/bug62653.phpt
@@ -0,0 +1,33 @@
+--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 = "5";
+$foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double"
+$name = "foo";
+unset($array[$$name]);
+print_r($array);
+
+?>
+--EXPECT--
+Array
+(
+)
+Array
+(
+)
+Array
+(
+)