Why are the variables "$get_a" and "$get_b" not visible with "get_defined_vars()" in either "my_object" or "my_other_object"?

The variables "$get_a" and "$get_b" are not visible with "get_defined_vars()" in either "my_object" or "my_other_object" because they are private properties of the objects and not part of the global scope. To access these private properties, you can create getter methods within the classes that return the values of these variables.

class my_object {
    private $get_a = 'value_a';

    public function getA() {
        return $this->get_a;
    }
}

class my_other_object {
    private $get_b = 'value_b';

    public function getB() {
        return $this->get_b;
    }
}

$obj1 = new my_object();
$obj2 = new my_other_object();

echo $obj1->getA(); // Output: value_a
echo $obj2->getB(); // Output: value_b