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

    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>