ramblings on PHP, SQL, the web, politics, ultimate frisbee and what else is on in my life

The PHP4 dilemma!?

I think there is something wrong with Matt’s argument in that he overlooks the fact that we are talking about open source here. The developers of said applications are probably all among the people that have servers available. So if the decide to move on, its only a question of the hosters flipping the switch to increase the number of machines they deploy their PHP5 images on.

At any rate, the developers currently have to slow down their development process because they have to support the old OO model (which has some annoying characteristics), cannot leverage things like PDO (I know how much work it is to unify both the client and SQL API's, so I know how to appreciate only having to do the SQL side of things, even though I still have some issues with the PDO API), iterators or simplexml. By not having these features available they have to waste time working around the limitations of PHP4. Today the end users do not feel their pain directly.

Indirectly they do however. More bugs due to userland implementations of things available in PHP5 (now with PHP 5.2 most PHP5 features are mature and stable), slower code or more time needed to make the same features fast enough without using PHP5 features etc.

So yes, the problem with PHP5 adoption is that it did not really make anything new possible. Instead it focused on making life easier for developers. Of course people needed to learn about all the new features and best practices needed to mature around them (Well I still think some people confuse Exceptions for a control mechanism or think that overloading is the answer to everything). As a result you can give your end users everything with PHP4 already, then again you could also with sticking to writing in assembler.

By moving to PHP5 developers can more easily make the code lean, fast and reliable. The benefits to the end users might not be immediately apparent, but they should not be denied. What is the effort on the end users side? Well in all honestly very little. They need to keep updating their software today already as security releases are made available. Same goes for the hosters when it comes to keeping their PHP4 installs up to date.

So while I do realize that there will be some pains here, I do not see that as significant enough to continue to slow down development of PHP apps.


Re: The PHP4 dilemma!?

As a PHP developer I can say, well, that I'm tired of this story of "I want but I can't".

PHP is not an Object Oriented language, it's a mixture of global functions, pretty bad syntax (. and + are not the same!!) and an OO engine.

Ask Java developers if their life couldn't be more reliable with getters and setters or operator overloading, but in order to maintain a single language spec that doesn't break things (and formation) they accept what they have.

Please take a minute and think that PHP is the only language in the last 10 years that has been radically rewritten and restructured ¡4 times!. And for people like me, that has invested man-months in writting, debugging and improving my own PHP4 framework, this is a f***ing big issue to deal with.

So I have decided to move to a new platform and language. Maybe C#/XSP, maybe Python, maybe Java, I don't know, but it will be one whose developers don't regret it past decisions and change everything every 3 years.

Re: The PHP4 dilemma!?

My PHP3 applications moved to PHP4 and then to PHP5 with no more than a few tweaks.

The changes between 4 and 5 were relatively small for me.

Obviously, as time has progressed I've introduced code that is specific for the later versions and there's no way I'm going back to PHP4!



Re: The PHP4 dilemma!?

Lolaine said
So I have decided to move to a new platform and language. Maybe C#/XSP, maybe Python, maybe Java, I don't know, but it will be one whose developers don't regret it past decisions and change everything every 3 years.

Are you serious? As a PHP developer, I don't see any challenge in making a switch from PHP4 to PHP5. All the changes I have had to make so far is fun and exciting to work with. No hassle here. I don't understand why you face with so much obstacles. Java or .NET are complicated and system-level technologies. You will find yourself looking back quite often after then.

Web hosting community response to this news is quite positive: http://www.webhostingtalk.com/showthread.php?t=620194

Re: The PHP4 dilemma!?

@Lolaine: I take it you haven't hung around many Javascript circles. In an untyped or loosely typed language, using the same operator for concatenation and addition is a huge PITA. It's easily the number one complaint about Javascript. I'd want to kill myself if I had to explicitly cast everything in PHP before I could do any sort of math. :-)

Java also adds new features periodically as well. Recall the big deal that generics and autoboxing were in Java 1.5 aka Java 5. Well, in PHP we get excited about a new XML library (not a core language change, a library addition) and an OO model that IMO is nicer than Java's. Every language has these growth spurts.

Re: The PHP4 dilemma!?

Rob: Is your PHP application object oriented? I don't think so, since php3 (afaik) didn't have class support. And if your application is not object-oriented, there is no major reason for migrating from 4 to 5.

pcdinh: Please read de PHP5 documentation about objects. You will see a lot of changes. One of the most annoying is the reference-handle (php5) vs the local-copy-on-write (php4) method of doing things. I'm not discussing that the change is for better object orientation, but it's a major change that break things. (see http://mjtsai.com/blog/2004/07/15/php-5-object-references/)

Larry Garfield: Yes they do. But they don't regret past decisions, they don't break things like PHP has done with the oo-PHP4->oo-PHP5 move . Java can call itself Java from 1.0 to 1.5, but PHP has taken 4 revisions where there have been changes to the core of the language (at least in the object orientation) that from my point of view has been real forks of the project maintaining the name.

Re: The PHP4 dilemma!?

PHP3 did have very limited OO support.

Before you can post a comment please solve the following captcha.

your name: