How does the concept of static in PHP classes relate to object-oriented programming principles?

In object-oriented programming, the concept of static in PHP classes allows for the creation of methods and properties that belong to the class itself rather than to instances of the class. This means that static methods and properties can be accessed without needing to create an object of the class. This can be useful for utility functions or for storing shared data across all instances of a class.

class MathUtils {
    public static function add($num1, $num2) {
        return $num1 + $num2;
    }
}

echo MathUtils::add(5, 3); // Output: 8