How can one effectively combine Object-Oriented and Procedural programming styles in PHP without causing issues?

Combining Object-Oriented and Procedural programming styles in PHP can be achieved by encapsulating procedural code within classes and using objects to interact with them. This approach allows for better organization and reusability of code while still being able to leverage the benefits of procedural programming when necessary.

// Procedural code encapsulated within a class
class ProceduralFunctions {
    public static function calculateSum($num1, $num2) {
        return $num1 + $num2;
    }
}

// Object-oriented usage of the procedural function
$sum = ProceduralFunctions::calculateSum(5, 3);
echo $sum; // Output: 8