Welcome Guest, Not a member yet? Register   Sign In
PHP 4 or PHP 5

Hi all

I'm actually developing one extension to CodeIgniter, this extension is medium size, and I'm don't know if use PHP 4 or 5 to write the lib, writing in PHP 4 mantains de compatibility, but PHP 5 have so many language assets... and the PHP is reaching the version 6, and when this happen the PHP 4 code will not be compatible...

what you think about it? write the lib in PHP 4 or PHP 5?

compatibility with what? are you coding on servers that are not running PHP5?

There is really no need to write PHP4 if you know that your servers are running PHP5. It's not like if you code in PHP5 IE6 will crash... then again, just about everything breaks in IE6.

go with PHP5. the OOP improvements alone are worth it.

[eluser]Elliot Haughin[/eluser]
Regarding IE6:
I wouldn't put it past IE6 to crash over any old thing... I'm sure they must have a line of code in their exe that says something like:
if ( page_is_too_stylish )

On to more serious issues:
When using CodeIgniter, I always stick with PHP4. Because, that's what CI is written in. It makes sense to make your requirements for your extension match the requirements of the framework which runs it.

Don't get me wrong, I love PHP5... but if CI runs on 4.3.2+, then your whole application should too.

That makes sense, but PHP5 is backwards-compatible.

So, one day (I assume) CI will be released in PHP5, and all of your code will still be in PHP4. So will you rewrite all your old code in PHP5 so you have a match set? Or will you not install the PHP5 release?

We're not far from PHP6.

Also, PHP5 core comes with some great modules that are going to become essential for Web 2.0 applications (e.g. json_decode/json_encode for one).

There's nothing worse than browsing the PHP online documentation and finding the perfect function for your script, only to discover that it's not available in your install/version of PHP.

I decided to use PHP 5, I think PHP 4 is near to fall... and i really don't wanna rewrite all code... sorry for PHP 4 servers XD

i should clarify, you don't HAVE to rewrite your PHP4 code...

Theme © iAndrew 2016 - Forum software by © MyBB