xref: /PHP-8.2/ext/standard/tests/array/bug76713.phpt (revision f8d79582)
1--TEST--
2Bug #76713 (Segmentation fault caused by property corruption)
3--FILE--
4<?php
5
6function test($obj) {
7    return array_column(array($obj), "prop");
8}
9
10$obj = new Stdclass();
11
12$obj->prop = str_pad("a", 10, 'a');
13
14test($obj);
15test($obj);
16test($obj);
17
18var_dump($obj->prop);
19
20class C {
21    public $name;
22    public function __get($name) {
23        return $this->name;
24    }
25}
26
27$obj = new C;
28
29$obj->name = str_pad("b", 10, 'b');
30
31test($obj);
32test($obj);
33test($obj);
34
35var_dump($obj->prop);
36?>
37--EXPECT--
38string(10) "aaaaaaaaaa"
39string(10) "bbbbbbbbbb"
40