Skip to content

Commit 7d7b7e8

Browse files
committed
Merge branch 'PHP-7.2'
* PHP-7.2: Fix #76300 - Dont attempt to change visibility of a parent private
2 parents 5819ff4 + 671fc2e commit 7d7b7e8

File tree

3 files changed

+504
-498
lines changed

3 files changed

+504
-498
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
Bug #76300: Unserialize of extended protected member broken
3+
--FILE--
4+
<?php
5+
class Base {
6+
private $id;
7+
public function __construct($id)
8+
{
9+
$this->id = $id;
10+
}
11+
}
12+
class Derived extends Base {
13+
protected $id;
14+
public function __construct($id)
15+
{
16+
parent::__construct($id + 20);
17+
$this->id = $id;
18+
}
19+
}
20+
$a = new Derived(44);
21+
$s = serialize($a);
22+
$u = unserialize($s);
23+
print_r($u);
24+
--EXPECT--
25+
Derived Object
26+
(
27+
[id:protected] => 44
28+
[id:Base:private] => 64
29+
)

0 commit comments

Comments
 (0)