diff options
Diffstat (limited to 'ext/standard/tests/serialize/bug76300.phpt')
-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 +) |