How does object-oriented programming in PHP affect variable scope within functions?

Object-oriented programming in PHP affects variable scope within functions by allowing the use of class properties and methods within functions. This means that variables defined within a class can be accessed and modified within class methods. To access class properties within a function, you need to use the `$this` keyword followed by the property name.

class MyClass {
    public $myProperty = 'Hello';

    public function myFunction() {
        echo $this->myProperty;
    }
}

$obj = new MyClass();
$obj->myFunction(); // Output: Hello