This defines a class named Cart that consists of an associative array of articles in the cart and two functions to add and remove items from this cart. Classes are types, that is, they are blueprints for actual variables. You have to create a variables of the desired type with the new operator.
Classes can be extensions of other classes.
The extended or derived class has all variables and functions of the base class and what you add in the extended defintion. This is done using the extends keyword. You create a named cart the usual way and can now set and get the carts owner. Constructors are functions in a class that are automatically called when you create a new instance of a class. A function becomes a constructur when it has the same name as the class.