summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/bug76713.phpt
blob: 8bb8bf221fe8e1532ce061bcf7a639ace5754b93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--TEST--
Bug #76713 (Segmentation fault caused by property corruption)
--FILE--
<?php

function test($obj) {
    return array_column(array($obj), "prop");
}

$obj = new Stdclass();

$obj->prop = str_pad("a", 10, 'a');

test($obj);
test($obj);
test($obj);

var_dump($obj->prop);

class C {
    public $name;
    public function __get($name) {
        return $this->name;
    }
}

$obj = new C;

$obj->name = str_pad("b", 10, 'b');

test($obj);
test($obj);
test($obj);

var_dump($obj->prop);
?>
--EXPECT--
string(10) "aaaaaaaaaa"
string(10) "bbbbbbbbbb"