What are classes?

Requested by Carnuke and Answered by Mithrandir on 2004/10/28 20:55:11

What are classes?

Classes are structured elements used in Object Oriented programming for defining objects and grouping functions together in functional units.

An example is the XoopsUser class that defines user objects in XOOPS. The XoopsUser class defines the elements (or "properties") that describe a user; that is, a user has a username, a password, an email address and so on and some functions (or "methods") that describe actions related to a user - such as the incrementPosts() method that adds one to the user's postcount.

More information about classes and objects in PHP can be found on the php.net website:
Classes and Objects (PHP5)
Classes and Objects (PHP4)

This Q&A was found on XOOPS Web Application System : https://xoops.org/modules/smartfaq/faq.php?faqid=114