I am Studying PHP, OOP and i have learned a lot, but there is small things who tease me,
There is an image I created for illustration of object creation:Link
if someone could answer a few questions please...
- I will be happy if some one can correct me if i did something wrong with the image.
- When i try to echo an object i getting an error that say that the Object (i understand that the Object is the memory reference) cannot be converted to a string, if its not a string of the memory location name(example: 'F70') can i have an example please for how does memory location looks like.
- And about the variable containing the reference, i understand that this is a regular variable placed with all the rest of the global variables, i mean that if i create new object and a new variable the first object(variable) contain the reference but it is a regular global variable, same is the other variable:
First Step: i define the object variable...
Second Step: the Object created and it memory location getting inside the variable we wanted...
Third Step: New global variable created with our reference.
What mean that when i call a Object(variable):
First Step: We are going to the memory location where our variable created...
Second Step: The Variable value(reference) referring us to the memory location where the object is...
Third Step: We have access to methods and properties of that object.
I will be happy if some one can help me understand this things, thank you all and have a nice day.