How can object-oriented programming principles be applied to function calls in PHP?

In PHP, object-oriented programming principles can be applied to function calls by creating classes and objects to encapsulate related functions and data. This allows for better organization, reusability, and maintainability of code. By creating classes with methods that perform specific tasks, you can easily call these methods on objects to achieve the desired functionality.

// Define a class with a method
class Calculator {
    public function add($num1, $num2) {
        return $num1 + $num2;
    }
}

// Create an object of the class
$calc = new Calculator();

// Call the method on the object
$result = $calc->add(5, 3);

echo $result; // Output: 8