xref: /PHP-7.0/Zend/tests/bug46701.phpt (revision d980c018)
1--TEST--
2Bug #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
8$test_array = array(
9	0xcc5c4600 => 1,
10	0xce331a00 => 2
11);
12$test_array[0xce359000] = 3;
13
14var_dump($test_array);
15var_dump($test_array[0xce331a00]);
16
17class foo {
18	public $x;
19
20	public function __construct() {
21		$this->x[0xce359000] = 3;
22		var_dump($this->x);
23	}
24}
25
26new foo;
27
28?>
29--EXPECT--
30array(3) {
31  [-866368000]=>
32  int(1)
33  [-835511808]=>
34  int(2)
35  [-835350528]=>
36  int(3)
37}
38int(2)
39array(1) {
40  [-835350528]=>
41  int(3)
42}
43