3v4l.org

run code in 300+ PHP versions simultaneously
<?php class aaa { private static $tpl = array( 'sb_build_id'=>'', 'sb_build_name'=>'' ); public static $xxx = 'aaa'; function yyy(){ echo self::$xxx; } function genprops(){ foreach ($this->dbe as $k => $v) { echo $v; $this->$k = $v; } $this->a = "a"; print_r(get_class_vars(__CLASS__)); } } class ccc extends aaa { public $zzz=''; } class bbb extends ccc { /** * */ function tests(){ parent::$xxx = "bbb"; //echo $this->xxx; echo parent::$xxx; } } $aaa_o = new aaa(); $bbb_o = new bbb(); $bbb_o->yyy(); $bbb_o->tests(); #$bbb_o->genprops(); ?>

preferences:
43.81 ms | 402 KiB | 5 Q