tags:

views:

192

answers:

2

i want to study oops related php, mainly for mashups and some development. I started with php n mysql,

whats main relation or difference b/w php and php5. Is there anything like different php for web development and other php for software development??

guide me some books with php oops examples and concepts.........

A: 

PHP is a language. PHP 5 is a specific version of the language implementation, as opposed to 3, 4, or 6.

There are lots of alternatives to PHP. Almost any language can be used for web development via CGI, although it's more common to use a framework such as Django or Rails.

Ignacio Vazquez-Abrams
+2  A: 

Note: I am assuming by 'PHP to PHP5' you mean from PHP4 to PHP5. PHP5 is not a different languages from PHP, it is simply a different version.


PHP4 to PHP5

Here is the main differences between PHP4 and PHP5.

http://www.php.net/manual/en/migration5.php

The specific OOP changes are featured in the Object Model

http://www.php.net/manual/en/migration5.oop.php

One of the places that page points that will give you the basics to how OOP works in PHP would be the Classes and Object reference page:

http://www.php.net/manual/en/language.oop5.php


PHP Class Examples

If you want some specific examples of how OOP is used in PHP, you might want to look at my answer on some basic classes you might use in a web development setting:

http://stackoverflow.com/questions/2035449/why-is-oop-hard-for-me/2035482#2035482


Learning PHP

To learn PHP, you can do a search on PHP and OOP on StackOverflow, and the first few results give you resources to do so:

http://stackoverflow.com/search?q=php+oop

If you want to skip clicking the link, you can just go to http://php.net, cause I guarentee that almost all of them point there. PHP has one of the best documentations out there, and it is extremely easy to use, and you will return to it very, very often.

For the record, the first result talks about how to learn object-oriented programming in php.

Chacha102
yeah fo sho, php5 added oop that's the biggun
echo
@justin No, actually, if I am not mistaken: OOP was first introduced in PHP3, although very crudely; then improved in PHP4, more as an afterthought; but then finally done right in PHP5. - But the OOP in PHP4 was *usable*, even tho not perfect.
Atli
PHP5 was the first update that actually brought it up to snuff with the rest of the programming world. Some may consider PHP5 to be the first version the implemented true 'OOP'.
Chacha102
I am in no way endorsing PHP4 here; it is pure garbage in comparison - But whether you consider it "true" or not, PHP4 *does* include support for - at least basic - OOP, so saying PHP5 "added" OOP is incorrect. It did what upgrades generally do: it improved it.
Atli
Meh. I just want people to upgrade to PHP 5.3 so I can reliably use namespaces... In the scheme of removing global state from programs, Namespace probably takes the cake.
Chacha102