Jump to content

Recommended Posts

I am not putting in O.O.P forum becuase more of a general question.

 

Maybe it is just me or just the code I have looked at but most of the time when i see classes being used in PHP, generally they are just filled with method(function) and no members(variables).  And if they do are a member, generally only one and it is some type of database object.  Most of the time these methods just return arrays or information.  Is there any real good benefit from returning array inside formatting the array in the class into an object and the pass back the object.  I mean if you have a class of functions with no member, then you really don't have a class, just a bunch of functions with kinda of a namespace.  How do you use classes in php?  Do you just use classes to store data your objects needs and not alter any of that information?

Link to comment
https://forums.phpfreaks.com/topic/61853-class-usage-in-php/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.