class User { public static $count = 0; public function __construct() { self::$count++; } } User::setData('count', 10); // set count to 10
class ParentClass { public static $prop = "Hello"; } class ChildClass extends ParentClass { public static function setProp($newVal) { parent::setData('prop', $newVal); } } ChildClass::setProp("World"); // set prop to "World"The package library for this method depends on the context it is being used in. It could be part of a larger framework or just a standalone script.