1--TEST-- 2Reflection and inheriting static properties 3--FILE-- 4<?php 5 6class base { 7 static protected $prop = 2; 8 9 static function show() { 10 echo __METHOD__ . '(' . self::$prop . ")\n"; 11 } 12 13 static function inc() { 14 base::$prop++; 15 echo __METHOD__ . "()\n"; 16 } 17} 18 19class derived extends base { 20 static public $prop = 2; 21 22 static function show() { 23 echo __METHOD__ . '(' . self::$prop . ")\n"; 24 } 25 26 static function inc() { 27 derived::$prop++; 28 echo __METHOD__ . "()\n"; 29 } 30} 31 32base::show(); 33derived::show(); 34 35base::inc(); 36 37base::show(); 38derived::show(); 39 40derived::inc(); 41 42base::show(); 43derived::show(); 44 45$r = new ReflectionClass('derived'); 46echo 'Number of properties: '. count($r->getStaticProperties()) . "\n"; 47 48echo "Done\n"; 49?> 50--EXPECT-- 51base::show(2) 52derived::show(2) 53base::inc() 54base::show(3) 55derived::show(2) 56derived::inc() 57base::show(3) 58derived::show(3) 59Number of properties: 1 60Done 61