<?php class Test { protected static $val = 1; public static function setVal($value) { self::$val = $value; } public function val() { return self::$val; } } $t1 = new Test; $t2 = new Test; $t1::setVal(2); echo $t2->val();
You have javascript disabled. You will not be able to edit any code.