<?php trait T { private static ? int $in = null; public static function in() : int { if (empty(self::$in)) { self::$in = rand(0,10); } return self::$in; } } class A { use T; } class B { use T; } var_dump(A::in(), B::in());
You have javascript disabled. You will not be able to edit any code.