Why do objects in PHP seem to be automatically referenced?

Objects in PHP are automatically referenced because objects are passed by reference by default in PHP. This means that when you assign an object to a new variable or pass it as a parameter to a function, you are actually passing a reference to the object, not a copy of the object itself. To avoid this automatic referencing behavior, you can use the `clone` keyword to create a copy of the object.

// Example of cloning an object to avoid automatic referencing
class MyClass {
    public $value;
}

$obj1 = new MyClass();
$obj1->value = 10;

$obj2 = clone $obj1;
$obj2->value = 20;

echo $obj1->value; // Output: 10
echo $obj2->value; // Output: 20