Do you consider PHP 4 while developing new apps?

Should my web app be compatible with PHP 4? You know there are some big OO differences and database stuff.

What’s your idea? When PHP4 and IE6 can say goodbye!?

I won’t touch anything below 5.2.

Generally I find complete rewrites, without the restriction of older versions, allows for easier addition of features and more possibilities.

Though, to be fair, PHP 4 wasn’t exactly incapable - it just meant having to approach things differently.

The only reason to even think about php4 is if you have inherited a legacy app that won’t run on 5.

There is a massive difference between php and ie: with php you have control of the version, with ie the user does.

Basically: support ie6 as long as it is financially beneficial to do so; support php4 as long as you are getting paid to do so.

I mentioned ie here just for joking:). My question is just about PHP and the current servers support for php5.

I…started developing for 5.3 and up exclusively. Symphony has gone the same route with version 2 of there framework. For me version portability is the crutch of legacy cruft that I want no part of.

not me, I am still not using 5.3 as minimal requirement, but I do have 5.2 as my min required version

Absolutely not, PHP4 is broken and will never be fixed. :slight_smile:

there are some plugins can fix it and library file also available

Just: no.

With WordPress I’d expect new features to be added that will only function with PHP 5. The PHP 4 compatibility would be progressively removed as it interferes with the new features rather than someone specifically going through and rewriting everything to get rid of it. I’d expect the same to be true of any other open source software.

If it aint broke then why risk breaking it by trying to fix it?

If a client already had PHP4 hosting and I was doing minimal programming, like a contact form then I’d support it, but for anything else, no.

I’d like to start with PHP 5.3, mostly for namespaces, but for me that would be a bit limiting regarding hosting.
Logic Earth - do you have 5.3 host recommendations?

Thanks guys, NO is the right answer!

A poll would have been more effective :stuck_out_tongue:

I’d say about 10% of PHP developers bother with PHP 4 at current times. I still see a fair few people around the forums mentioning that their system is PHP4 or that they haven’t even personally made the jump from 4 to 5.

Me however - I can’t think of a realistic situation where PHP 4 is required. Servers can be upgraded and old software can be routed to PHP 4 if required.

PHP 4 is long dead and has a growing number of security holes in it that will never be plugged. There is no reason for doing any further development for it since anyone who has been asleep for the last couple of years and therefore missed its death can be advised to upgrade to a current versipn of PHP. Properly written scripts for PHP 4 will still work on PHP 5 so it is only if they are still using scripts intended for PHP 3 that they would have problems with the upgrade.

The question of whether to support old versions of software should only really arise in between the release of the replacement version and the death of the old version. So the question of whether to support PHP 4 was only really something that different people should have been making their own different decisions on would have been between the introduction of PHP 5 and the death of PHP 4 in 2008. There was plenty of time in between the introduction of PHP 4 and its death in 2008 to make any changes to code to upgrade from PHP 3 to change the things that PHP 3 supported and PHP 5 doesn’t (which were all flagged as deprecated in PHP 4 so you’d know that they were being removed).

I was checking db class of wordpress and discovered they somehow considered php4 compatibility


/**
	 * Connects to the database server and selects a database
	 *
	 * PHP4 compatibility layer for calling the PHP5 constructor.
	 *
	 * @uses wpdb::__construct() Passes parameters and returns result
	 * @since 0.71
	 *
	 * @param string $dbuser MySQL database user
	 * @param string $dbpassword MySQL database password
	 * @param string $dbname MySQL database name
	 * @param string $dbhost MySQL database host
	 */
	function wpdb($dbuser, $dbpassword, $dbname, $dbhost) {
		return $this->__construct($dbuser, $dbpassword, $dbname, $dbhost);
	}

	/**
	 * Connects to the database server and selects a database
	 *
	 * PHP5 style constructor for compatibility with PHP5. Does
	 * the actual setting up of the class properties and connection
	 * to the database.
	 *
	 * @since 2.0.8
	 *
	 * @param string $dbuser MySQL database user
	 * @param string $dbpassword MySQL database password
	 * @param string $dbname MySQL database name
	 * @param string $dbhost MySQL database host
	 */
	function __construct($dbuser, $dbpassword, $dbname, $dbhost) {
		register_shutdown_function(array(&$this, "__destruct"));

		if ( WP_DEBUG )
			$this->show_errors();

.....

are they right? of course it’s a personal decision

That is most likely backwards compatibility. If you’re starting a new project then it’s irrelevant.

At least for me, this is all dependent on the client if you do not have own server to deploy the site for your client. So if the client has server having PHP4 then one must be compelled to work for PHP even though we can suggest/recommend the client to go for PHP5 with lots of features. I have still one client who does not have the server upgraded to PHP5 because some websites are running with huge number files written in traditional PHP4 and I am also compelled to write codes for PHP4 which is also really panic for me in this era of OOP :wink: because I have PHP 5.3 in my local system for rest of the works and I always need to switch to PHP4 when I need to work for them.

And regarding IE6, we cannot avoid yet because most of the users in the world have Windows XP which originally has IE6 in it. In otherwise case, I would really have deleted/removed IE6 from my dictionary :slight_smile:

No question about new projects.

When WordPress was first created PHP 4 was the latest and greatest and so of course WordPress was designed to be able to run there. Why add to the workload by spending time deleting all the compatibility for PHP 4 when the time could be better spent adding new features?