1--TEST-- 2Overridden hooked property can add get to set only property 3--FILE-- 4<?php 5 6class A { 7 public $prop { 8 set { echo __CLASS__ . '::' . __METHOD__, "\n"; } 9 } 10} 11 12class B extends A { 13 public $prop { 14 get { echo __CLASS__ . '::' . __METHOD__, "\n"; return 42; } 15 set { echo __CLASS__ . '::' . __METHOD__, "\n"; } 16 } 17} 18 19$a = new A; 20$a->prop = 1; 21try { 22 var_dump($a->prop); 23} catch (Error $e) { 24 echo $e->getMessage(), "\n"; 25} 26 27$b = new B; 28$b->prop = 1; 29var_dump($b->prop); 30 31?> 32--EXPECT-- 33A::A::$prop::set 34Property A::$prop is write-only 35B::B::$prop::set 36B::B::$prop::get 37int(42) 38