PageRenderTime 39ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/zend/good/Zend/tests/bug62653.php

http://github.com/facebook/hiphop-php
PHP | 18 lines | 16 code | 2 blank | 0 comment | 0 complexity | 1dd9e71e924473877654715555375654 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?hh <<__EntryPoint>> function main(): void {
  2. $array = darray["5"=>"bar"];
  3. $foo = "10.0000"; // gettype($foo) = "string"
  4. $foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double"
  5. unset($array[$foo]);
  6. print_r($array);
  7. $array = darray["5"=>"bar"];
  8. $foo = "5";
  9. unset($array[(float)$foo]);
  10. print_r($array);
  11. $array = darray["5"=>"bar"];
  12. $foo = "10.0000";
  13. $foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double"
  14. unset($array[$foo]);
  15. print_r($array);
  16. }