Translations:Developers/Object oriented programming in PHP/Objects/7/en

then the normal rule for assignments in PHP applies: The content of $objBar is copied and assigned to $objFoo. But the content of $objBar is just the identifier of the object, so this identifier is copied. As a consequence both variables $objBar and $objFoo are pointing now to the same and identical object. In other words, the object can be accessed using both $objBar and $objFoo. A so called shared resource is created and the object isn't copied.