I'm learning php from http://www.hudzilla.org/phpbook/ right now and it was written for php5. I use Frihost and most hosts use php4 so I only want to know about php4. The thing I was wondering was, should I learn about classes/objects for php4? The book says that php5 has better OOP that is less buggy, but should I bother learning it to program in php4?
learning php
That really depends on what you need your script to do!!
| JustaMin wrote: |
| That really depends on what you need your script to do!! |
He is right. Learning and/or using OOP is not a must.
If you are experienced with OOP in other languages like C++ then learning in PHP is easy.So then you can give it a try.Learning anything does'nt go waste anyways.
| shankar wrote: |
| If you are experienced with OOP in other languages like C++ then learning in PHP is easy. |
He is right about that. If you already understand the concept of OOP, learning how classes are implented in PHP should be a piece of cake.
By the way, PHP 5 has made many advancements in classes as compared to PHP4. For example, PHP4 doesnt support function(method) or variable(member) overloading where as PHP5 does.
| snowboardalliance wrote: |
| I'm learning php from http://www.hudzilla.org/phpbook/ right now and it was written for php5. I use Frihost and most hosts use php4 so I only want to know about php4. The thing I was wondering was, should I learn about classes/objects for php4? The book says that php5 has better OOP that is less buggy, but should I bother learning it to program in php4? |
PHP 5 scripts are backwards compatible to PHP 4, that is, if you do not use the features exclusive to PHP 5. Basically, if you are only going to do "simple" PHP scripts and would not use such features of PHP 5 that are not in PHP 4, it would be just fine. I would recommend that you just use the PHP documentation found in PHP's web site.
You could download the documentation from here: http://www.php.net/docs.php
