Jump to content

php Classes


mrome

Recommended Posts

Does anyone know where I can have a good read about how classes work in php.

Because I have a few questions.

Do they get held across requests or do they get destroyed once the response has been sent?

Why we have an OO way of writing and a procedural way of writing something.

Is the OO way faster? smarter? Or is it purely readiblity?

If anyone has a good grounding in this topic, please send me a link to some information about it.
Link to comment
Share on other sites

I can answer most (if not all) your questions on OOP.

Yes, they got destroyed once script exited.  Actually everything got destroyed once the script exited.  That's why you need to use SESSION

OOP is wonderfull and best method of programming.  If everything in your site is OO and having a nice design structure, you're ahead of everyone else.

Link to comment
Share on other sites

[quote author=hvle link=topic=100364.msg396091#msg396091 date=1152757637]
OOP is wonderfull and best method of programming.  If everything in your site is OO and having a nice design structure, you're ahead of everyone else.
[/quote]

I thought I would point out that there is no best way of programing. OOP is just one way. There are several different ways of programing anything: functional, declarative, sequential, procedural, and object oriented. All have their strengths. OOP provides the structure for those begining to program as well as any group programers who do not already know each other's style of programing.

Once you feel you got a good handle of OOP, move on to other styles. Try not to get stuck on one particular style, for when you can combine them all together you can really do much much more.
Link to comment
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.