GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP Developers... please join me for a discussion on PHP5. (https://gfy.com/showthread.php?t=778928)

StuartD 10-23-2007 06:22 PM

PHP Developers... please join me for a discussion on PHP5.
 
We all know that PHP5 is better than PHP4... that's great. But can you give some real world (maybe personal) examples of yours where you've found PHP5 to be preferred over PHP4.

Don't get me wrong with this thread, I have my own to share but I'd like to have this more as an informative thread for all developers to learn and share.

It's one thing to read up the new features and new terminology... but I'd love to hear anyone who's been developing for PHP5 to share personal experiences.

k0nr4d 10-24-2007 01:53 AM

Well, personally the main advantage of 5 over 4 for me is the additional functions. SimpleXML for example, makes parsing xml significantly easier. The addition of file_get_contents/file_put_contents (I forget which was added in php5) has also made it much easier to work with flat files.

Additionally, php4 has had its end of life announcement, and as of the new year no additional versions of php4 will be released.

The only incompatibilities between scripts I've seen for php4 not running under php5, is due to register_globals being off by default in php5.

Arty 10-24-2007 02:03 AM

Also be careful with the use of array_merge in your code when moving from php4 to 5 :2 cents:

Mutt 10-24-2007 02:04 AM

Quote:

Originally Posted by k0nr4d (Post 13279416)
Well, personally the main advantage of 5 over 4 for me is the additional functions. SimpleXML for example, makes parsing xml significantly easier. The addition of file_get_contents/file_put_contents (I forget which was added in php5) has also made it much easier to work with flat files.

Additionally, php4 has had its end of life announcement, and as of the new year no additional versions of php4 will be released.

The only incompatibilities between scripts I've seen for php4 not running under php5, is due to register_globals being off by default in php5.

goooooooooo k0nr4d !

StuartD 10-24-2007 04:59 AM

Ok, so SimpleXML makes xml easier.

array_merge() now only takes array types rather than just allowing anything to be merged in.

Register_globals is now off by default, as it should be.

Awesome stuff... has anyone been doing some more advanced class/object creation using PHP5 yet?

Calvinguy 10-24-2007 05:37 AM

Quote:

Originally Posted by StuartD (Post 13279855)
Ok, so SimpleXML makes xml easier.

array_merge() now only takes array types rather than just allowing anything to be merged in.

Register_globals is now off by default, as it should be.

Awesome stuff... has anyone been doing some more advanced class/object creation using PHP5 yet?

OOP has changed but it is backwards compatible so you should have no problems, I didn't at least.

teg0 10-24-2007 06:01 AM

SimpleXML hands down. Parsing feeds is effortless.

AcidMax 10-24-2007 06:09 AM

There were a lot of enhancements to php5, security fixes, speed fixes as well as OOP changes. Things like private, public and static functions etc. PHP5 should be used imho over php4, but hosts have done a poor job of getting php5 in the market place. That being said, php5 has major issues like namespaces. To me PHP5 has pretty much died and most of my stuff has been replaced with other languages that are not only faster but much more structured.

PHP6 is going to have a lot of these things fixed supposedly , but I will believe it when I see it.

StuartD 10-24-2007 06:10 AM

Quote:

Originally Posted by Calvinguy (Post 13279933)
OOP has changed but it is backwards compatible so you should have no problems, I didn't at least.

Not that I can see, the way it handles child classes and brand new function structures such as __constructor().

StuartD 10-24-2007 06:11 AM

Quote:

Originally Posted by AcidMax (Post 13279993)
There were a lot of enhancements to php5, security fixes, speed fixes as well as OOP changes. Things like private, public and static functions etc. PHP5 should be used imho over php4, but hosts have done a poor job of getting php5 in the market place. That being said, php5 has major issues like namespaces. To me PHP5 has pretty much died and most of my stuff has been replaced with other languages that are not only faster but much more structured.

PHP6 is going to have a lot of these things fixed supposedly , but I will believe it when I see it.

What other languages are you using in PHP's place?


All times are GMT -7. The time now is 06:04 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123