How to access properties inside PHP?
<p>Follow up based on this document: https://www.php.net/manual/en/language.oop5.references.php</p>
<blockquote>
<p>A key point of PHP object-oriented programming that is often mentioned is that "objects are passed by reference by default." This is not entirely correct. </p>
</blockquote>
<blockquote>
<p>In PHP, object variables do not contain the object itself as a value. It simply contains an object identifier that allows object accessors to find the actual object. </p>
</blockquote>
<p>How does this actually work? For example, in C, the arrow operator seems to implicitly dereference the pointer and then access the property as if it were accessed on the object variable itself. </p>
<p>This is how I understand it:</p>
<pre class="brush:php;toolbar:false;">obj->prop
(*obj).prop // Equivalent to the line above</pre>
<p>This looks very neat. In both cases, the property call is the sum of the object variable address and the property offset. </p>
<p>But how does this work in PHP?
The documentation suggests that a pointer does not store a memory address, but rather an "object identifier". Is accessing properties in PHP a highly abstract process, or do you resolve the object identifier into a memory address and then access it similar to C/Java etc.? </p>