Jump to content
phpsane

What is an "Object" in Php ?

Recommended Posts

Folks,

 

What is an "Object" in php ?

These are not useful:

https://www.google.com/search?q=what+is+an+object+in+php+%3F&oq=what+is+an+object+in+php+%3F&aqs=chrome..69i57j69i64.6694j0j7&sourceid=chrome&ie=UTF-8

 

And these are too complicated as when they try describing an "Object", they shift to "Class". And we know the "Class" is advanced stuff.

https://www.w3schools.com/php/php_datatypes.asp

http://php.net/manual/en/language.types.object.php

And so, to newbies, how can you describe an "Object" in a layman's way without shifting towards more complex stuffs like complex functions, etc. ?

I'd like to see a few examples of an object with very simple & basic coding that is easily understandable to a beginner.

I'm sure future newbies would appreciate your hard work! :)

 

Thanks!

Share this post


Link to post
Share on other sites

You probably just need to read up on object-oriented pogramming.

 

Objects and Classes go hand-in-hand, you can't learn one without the other.

 

A class defines a structure that combines both data and functions. The class doesn't have any actual data associated with it, just definitions for what data can be associated with it.

 

An object is an individual instance of a particular class. The object as real data attached to it. Multiple object can be created for a given class, each with it's own set of data.

  • Like 1

Share this post


Link to post
Share on other sites

You probably just need to read up on object-oriented pogramming.

 

Objects and Classes go hand-in-hand, you can't learn one without the other.

 

A class defines a structure that combines both data and functions. The class doesn't have any actual data associated with it, just definitions for what data can be associated with it.

 

An object is an individual instance of a particular class. The object as real data attached to it. Multiple object can be created for a given class, each with it's own set of data.

 

When you get the time, would be better if you showed 2 examples and pointed-out the class and the object in your code.

 

Thank you.

Share this post


Link to post
Share on other sites

It would be most beneficial if you did some of your own reading instead of begging the forum to spoon-feed you with every question you post.  This is a business that absolutely requires one to read to learn in order to become a decent programmer.  There is no shortcut.  There are no excuses.

Share this post


Link to post
Share on other sites

It would be most beneficial if you did some of your own reading instead of begging the forum to spoon-feed you with every question you post.  This is a business that absolutely requires one to read to learn in order to become a decent programmer.  There is no shortcut.  There are no excuses.

 

When the reading gets too complicated speaking robo lang, that's when I try the humans in the forum to speak the human lang. If you get what I mean.

The manual speaks robo lang. Tutorials like the following speak human lang but sometimes they don't go enough deep or don't answer some basic questions. That's- when I hassle the forum. Actually, I'll harass you for answers from now on. Lol! ;)

 

tizag.com

tutorialspoint.com

tutorialrepublic.com

codeacademy.com

 

So, don't you worry. I got my foot in the tutorials. And it's all soaking in the puddle. From time to time, I'll lift the leg up real fast enough for it to generate splashes this way with all the muddy and dirty water. You'll help me in my dirty works (if not do them completely for me. Lol!)

Edited by phpsane

Share this post


Link to post
Share on other sites

If you read the OFFICIAL Manual you would get succinct and accurate answers to many of your questions as well as plenty of examples.  

 

Read

Read

Read.

 

BTW - it is not robo language.  It is English.  Are you going to tell your future boss that you can't read and understand English?

Share this post


Link to post
Share on other sites

I'll also suggest this book - I've got (and continue to read) the second, third, and fourth editions. Unfortunately, Barnes & Noble doesn't yet offer the fifth edition as a Nook book, so I'm still waiting on that...

Share this post


Link to post
Share on other sites

I'll also suggest this book - I've got (and continue to read) the second, third, and fourth editions. Unfortunately, Barnes & Noble doesn't yet offer the fifth edition as a Nook book, so I'm still waiting on that...

 

Thanks for the link!

Share this post


Link to post
Share on other sites

If you read the OFFICIAL Manual you would get succinct and accurate answers to many of your questions as well as plenty of examples.  

 

Read

Read

Read.

 

BTW - it is not robo language.  It is English.  Are you going to tell your future boss that you can't read and understand English?

 

The great thing is: I am not learning php to have any boss. Why go through EDU to be someone else's 9-5 wage slave ?

Why not be selfemployed ?

Study only to be selfemployed. To save yourself from wage slavery. That is the way to go.

Share this post


Link to post
Share on other sites

Classes are the wrapper for most of what Objects are.     Programming is ENTIRELY "advanced stuff".  Take it or just leave and find another occupation.

Why do so very, very many people think that this business is supposed-to-be-easy-to-master?  And why do these same people turn to the people (HERE!) THAT HAVE TAKEN THE TIME TO READ AND LEARN when they want answers that they don't want to learn for themselves?

Apparently you are just another non-reading wanna-be.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.