PHP 6

Posted in Technicalon Mar 14, 2006

I’ve been spending a lot of time recently writing some web applications in the PHP language. I have been writing my application in PHP 5 because I really like its ability to support object-oriented programming.

I recently read a very good post at jero.net which talks about what I might be able to expect from PHP version 6. A lot of it seems exciting, but not exciting enough.

PHP is such an easy language to pick up that many PHP programmers don’t spend enough time picking up good habits, and end up writing bad code. From what I’ve been able to gather from Jero’s comments, PHP 6 will help developers loose at least a few of some old bad habits. This is a welcomed change.

I think PHP 6 should increase its object-oriented programming model. It would be nice to have return type hinting, and to be able to do parameter type hinting with primitive types.

Also, I would like to see object-oriented programming methods used with some of the core PHP functions. For example, it would be nice if some functions threw exceptions instead of errors or warnings. I think catching an exception is a lot better than trying to deal with the “@” operator and dealing with various errors.

PHP 5 is being slow to catch on. I think that is mostly because Linux distributions have been slow to include PHP 5 and many server environments are even slower to upgrade their systems from something that has been working and tested. If I remember right, PHP 4 was also slow to catch on. If PHP 6 comes out soon, I think we will see many people make a slow, eventual switch from version 4 directly to version 6. If PHP 6 comes out later rather than sooner, I think we will see at that point that most people have made a switch to version 5, and we will again see a very slow adoption period for the latest version.

Related posts

  1. Suggestion for PEAR
  2. Things that make me happy
  3. Why PHP?

One Comment

Jacob

March 14th, 2006 at 2:57 am

Ok, so the whole exception catching thing — I might have been wrong about PHP5. I was looking at this slide and it looks like you can catch exceptions from core PHP functions.

I wish I knew more about this. When am I able to catch an exception?

Comment Form

Categories