diff options
author | Pedro Magalhães <mail@pmmaga.net> | 2018-05-03 21:25:12 +0100 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2018-06-17 15:53:55 -0700 |
commit | 13e9a471d79b5f845d087dd97c2f96d04493151e (patch) | |
tree | baac62d8a0fbab2da1a8fa3bf16f099628d439e9 /ext/standard/tests | |
parent | f31ba7cb53271f6745c5efb1b15c53ffd5cb4b6e (diff) | |
download | php-git-13e9a471d79b5f845d087dd97c2f96d04493151e.tar.gz |
Fix #76300 - Dont attempt to change visibility of a parent private
Diffstat (limited to 'ext/standard/tests')
-rw-r--r-- | ext/standard/tests/serialize/bug76300.phpt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ext/standard/tests/serialize/bug76300.phpt b/ext/standard/tests/serialize/bug76300.phpt new file mode 100644 index 0000000000..13e50f0332 --- /dev/null +++ b/ext/standard/tests/serialize/bug76300.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #76300: Unserialize of extended protected member broken +--FILE-- +<?php +class Base { + private $id; + public function __construct($id) + { + $this->id = $id; + } +} +class Derived extends Base { + protected $id; + public function __construct($id) + { + parent::__construct($id + 20); + $this->id = $id; + } +} +$a = new Derived(44); +$s = serialize($a); +$u = unserialize($s); +print_r($u); +--EXPECT-- +Derived Object +( + [id:protected] => 44 + [id:Base:private] => 64 +) |