1--TEST-- 2get_class_vars(): Testing visibility 3--FILE-- 4<?php 5 6class A { 7 protected $a = 1; 8} 9 10class B extends A { } 11 12class C extends B { } 13 14var_dump(get_class_vars('A')); 15var_dump(get_class_vars('B')); 16var_dump(get_class_vars('C')); 17 18print "---\n"; 19 20class D extends B { 21 public function __construct() { 22 var_dump(get_class_vars('A')); 23 var_dump(get_class_vars('B')); 24 var_dump(get_class_vars('C')); 25 } 26} 27 28new D; 29 30?> 31--EXPECT-- 32array(0) { 33} 34array(0) { 35} 36array(0) { 37} 38--- 39array(1) { 40 ["a"]=> 41 int(1) 42} 43array(1) { 44 ["a"]=> 45 int(1) 46} 47array(1) { 48 ["a"]=> 49 int(1) 50} 51