class myClass { public function __construct() { self::setDescription('This is my class'); } private static function setDescription($desc) { // set description of class } }
class myClass { public function myMethod() { self::setDescription('This method does something'); // method functionality } private static function setDescription($desc) { // set description of method } }In this example, the setDescription function is called within the myMethod method of the myClass class. The description of the method is set to "This method does something". This function is not part of any package library as it is a user-defined function that can be used in any PHP code.