bug46701.phpt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --TEST--
  2. Bug #46701 (Creating associative array with long values in the key fails on 32bit linux)
  3. --SKIPIF--
  4. <?php if (PHP_INT_SIZE != 4) die('skip this test is for 32bit platforms only'); ?>
  5. --FILE--
  6. <?php
  7. $test_array = array(
  8. 0xcc5c4600 => 1,
  9. 0xce331a00 => 2
  10. );
  11. $test_array[0xce359000] = 3;
  12. var_dump($test_array);
  13. var_dump($test_array[0xce331a00]);
  14. class foo {
  15. public $x;
  16. public function __construct() {
  17. $this->x[0xce359000] = 3;
  18. var_dump($this->x);
  19. }
  20. }
  21. new foo;
  22. ?>
  23. --EXPECTF--
  24. Deprecated: Implicit conversion from float 3428599296 to int loses precision in %s on line %d
  25. Deprecated: Implicit conversion from float 3459455488 to int loses precision in %s on line %d
  26. Deprecated: Implicit conversion from float 3459616768 to int loses precision in %s on line %d
  27. array(3) {
  28. [-866368000]=>
  29. int(1)
  30. [-835511808]=>
  31. int(2)
  32. [-835350528]=>
  33. int(3)
  34. }
  35. Deprecated: Implicit conversion from float 3459455488 to int loses precision in %s on line %d
  36. int(2)
  37. Deprecated: Implicit conversion from float 3459616768 to int loses precision in %s on line %d
  38. array(1) {
  39. [-835350528]=>
  40. int(3)
  41. }