PHP 4 vs 5? Need general advice

PHP 4 seemed relatively easy to get to grips with after an initial hair-tearing out period. I have now been told that PHP 5 is a step toward making it as unpleasant to use as any Visual Studio style langauage. That is, it has an object model that you have to stick to and variables have to declared properly and so on….

I thought the value of php was due to the way that any half-arsed neophyte could get a dynamic website running without having to worry about the demonic “object classes” and so on.

Is it true that standard programming logic has replaced the pleasantly ad hoc nature of php4 coding? If so, how back-compatible is it? Can I continue writing illogical but fast php code or do I have to draw a dozen class diagrams before I start and decide the names and types of any variable I might choose to create before I start?

On the plus side is it true that there is a short php5 alternative to the dreaded dbConnector stuff? Is it really easy to set up?

I want to know if it’s worth struggling with the new version in the hope it will have advantages, in the face of the fact that installing and configuring the thing is always the worst bit.


Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/wp-db.php on line 3030

Deprecated: Creation of dynamic property WP_Query::$comments_by_type is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/comment-template.php on line 1525

2 thoughts on “PHP 4 vs 5? Need general advice

  1. I have never really noticed any difference between PHP4 and 5. All the PHP based sites I have made, migrated over to PHP5 with no code editing and (apparently) no problems.

    Not sure what the deal with the dbConennector thing is – I have not yet written any scripts from scratch in PHP5. The old methods still work.

    Guess which version this blog uses?

  2. If you check the phpinfo() on a PHP 5 system you can see some of the differences between 4 and 5.

    Generally speaking 5 seems *easier* to use (so far). Time will tell if this is actually the case.

Comments are closed.