What impact do you believe PHP6 will have?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Personally I've begun thinking its PHP5 that will get the boot - the PHP5 base is so small, and so full of the more educated professional element (like us ;)) that we're more likely to jump onto PHP6 once the current PHP5 hosts make the move. Actually I can PHP6 the moment its released since my host allows a custom compiled version. The one thing I have not looked at is the cliff height. How much work will it be to migrate an application to PHP6, compared to the PHP4 to PHP5 jump which is huge when you consider the mountain of PHP4 code that hasn't even bothered to migrate to PHP4.4 let alone PHP5.

In any case a big driver of PHP is not its OOP - it's the simple use of procedural functions, globals et al. For such users, PHP5/6 hasn't much more to offer once you stop referring to anything related to the OO model.
The reason I'm starting to feel like it's going to change nothing is that nobody is talking about it except the elitist PHP developers.
A lot of that is because PHP Radio seems completely jammed on the Unicode channel. ;) Very few public blogs mention anything but Unicode since it's a big deal - Unicode support means PHP being more of an option to international users and becoming simple for all those ASCII fanatics to deal properly with Unicode, esp. now that MySQL is not an excuse.
Maybe if Zend actually dropped official support for PHP4 themselves it would push things forward.
Corporate suicide :).
You think, with two newer versions available, PHP web hosts would feel an immense amount of pressure to upgrade, or at least offer PHP6 support in some form? We need someone from a webhosting company to chime in here...
I doubt it. PHP6 if anything will only widen the gap - it may even make things worse. I think the only real thing that will get PHP4 reduced in market share is for PHP5/6 developers to pump out tons of applications which require PHP5 and will *not* run under PHP4. Unfortunately the killer app called phpBB is still PHP4 along with many others - maybe when a phpBB4 appears ;). To be perfectly honest I don't expect to move to PHP6 until it has overtaken PHP5 - far more likely than either overtaking PHP4.
d11wtq wrote:Perhaps not. I hate to admit it on a PHP forum, but I personally enjoy programming in Java more these days.
That's nothing to be ashamed of ;).
Given all the features in PHP5 that can easily be lived without, they still have not implemented things that would actually be useful, such as a Request/Response object, or Filter/Validator objects. Things that would actually help bad programmers. Instead we have lots of low value features and the Iterator extravaganza that is SPL.
As you mentioned, parts of the Zend Framework are missing a lot - I already refuse to use at least two components as they stand - they would drive me up the wall when it came to substitution or refactoring. PHP6 won't add anything new in those areas I think. At least we have SPL - it's good to see folk using a standard interface for something :). I think the ZF will just take time to mature - at the moment development is restriced to the roadmap which doesn't allow for many large shifts or additions. Hopefully a stable point release will motivate people to make the needed changes before depending applications are too entrenched.
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

d11wtq wrote:
neophyte wrote:Who says you can't continue to write PHP4 style code in 5 or 6?
You can't write (OO) code which runs under E_ALL in PHP4 and E_STRICT in PHP5. That's not up for debate, you just can't.
Actually you can. I know, as I have done it. :)

More thoughts in a moment after I finish reading the thread.
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

There are only three really big observable differences between PHP 4 and PHP 5 (yes there are a number of new functions in PHP 5 but they aren't that big of a deal).

1. PHP Data Objects (PDO) extension for an overall Database Abstraction Layer

2. UNICODE support for many string functions.

3. An expanded OOP engine.

None of these things are absolutely necessary for the vast majority of PHP programs or programmers. They do make some things EASIER to do. But are they enough to make it attractive to move to exclusively programming in PHP 5 using PHP 5 only functions and syntax?

For most programmers...

No.

There just isn't anything in PHP 5 that makes it worth while to switch to PHP 5 exclusivity. PDO can be duplicated through any number of Database Abstraction Layers. UNICODE can also be supported through a number of different string manipulation packages. And the extras in the OOP engine are nice but NOT REQUIRED to create object oriented programs.

It is just as easy/hard to create a program using PHP 4 exclusive code that will run under PHP 5 with E_STRICT enabled as it is to write PHP 5 exclusive code under the same restrictions.

This is one reason I haven't created a PHP 5 branch for either ADOdb Lite or Template Lite. There isn't a NEED for it. I do all of my development under PHP 5.2.1 and as long as I do not use PHP 5 exclusive OOP architecture the code will run just fine on both PHP 4 and PHP 5.

And you have to remember as a business concern, even though PHP is Open Sourced it is still a Business, they have to maintain as much backwards compatibility as possible. If they don't they will lose a large chunk of support and hosts will NOT upgrade to newer versions of PHP. With PHP 6 they could drop all support for PHP 4 OOP programming but they would be cutting their own throats and they know it. You wouldn't see any of the hosting companies upgrading and only a very, very SMALL number of programmers switching to it. It would be economic suicide for both PHP and the programmers that use PHP to switch to a version of PHP that wasn't as backwards compatible as possible to code written for PHP 4.

I, personally, will continue to write code that will work in both PHP 4 and PHP 5. Maintaining two branches is just plain silly as you really don't gain anything by doing so. I guess that is because I want to target the widest audience possible with the least effort. :D

When it comes to PHP 6 if they don't maintain that backwards compaibility you can just about kiss adoption of PHP 6 goodbye. It will take it at least a decade to get widely adopted.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

AKA Panama Jack wrote:
d11wtq wrote:
neophyte wrote:Who says you can't continue to write PHP4 style code in 5 or 6?
You can't write (OO) code which runs under E_ALL in PHP4 and E_STRICT in PHP5. That's not up for debate, you just can't.
Actually you can. I know, as I have done it. :)

More thoughts in a moment after I finish reading the thread.
Ok, show me a PHP4 class which will run under E_STRICT in PHP5 :?
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Just a few notes.

PDO is not an abstraction layer in the traditional sense - it is however a powerful option since it offers something almost as good, a unified interface. PHP Unicode support at present is almost non-existent, or where it does its inconsistent. You'll have to wait for PHP6 before true full featured support is actually possible.

Despite the obvious failings PHP5 is better. You can still run PHP4 code on it, and you can take advantage (if OOP inclined) of the much improved OO model. The problem isn't motivation to use PHP5 to develop, it's maintaining working applications for PHP4 - for which there are countless reasons which form a big circle mentioned earlier. This puts hosts in the position of having to support PHP4 to match user demand since they use applications which cannot run in PHP5, which is again worsened by the population of legacy applications, which of course means few non-professional developers have any public PHP5 access nor a market to work with. It's simple economics at work - PHP4.3, 4.4 and PHP5 (better BC between increments) are not substitute products since they are not fully backwards compatible. They are in fact competitors. That's largely why I think PHP6 will take over from PHP5, but not PHP4.
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

d11wtq wrote:
AKA Panama Jack wrote:
d11wtq wrote: You can't write (OO) code which runs under E_ALL in PHP4 and E_STRICT in PHP5. That's not up for debate, you just can't.
Actually you can. I know, as I have done it. :)

More thoughts in a moment after I finish reading the thread.
Ok, show me a PHP4 class which will run under E_STRICT in PHP5 :?
The two in my signature. :) When I first started out that was one of the complaints from some users. They pointed out the E_STRICT faults and both packages can run with E_STRICT enabled and they use PHP 4 only OOP. As I said I develop under PHP 5.2.1. :)
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

Maugrim_The_Reaper wrote:PDO is not an abstraction layer in the traditional sense - it is however a powerful option since it offers something almost as good, a unified interface.
Well, it's pretty close and they call it a Data Access Abstraction Layer in the documentation. ;)
Maugrim_The_Reaper wrote:PHP Unicode support at present is almost non-existent, or where it does its inconsistent. You'll have to wait for PHP6 before true full featured support is actually possible.
Well, you can have UNICODE support for both PHP 4 and PHP 5 as long as the host has installed the mbstring module and compiled PHP to use it. I don't know how many hosts offer Multibyte String support.

Even at that you have to use the specific functions http://us3.php.net/manual/en/function.m ... coding.php in your code instead of the normal string manipulation functions. IE: mb_strpos instead of strpos. The more logical thing to have done with the Multibye Module would have been to add an optional argument to the existing functions [, string $encoding] . This would offer backwards compatibility to older versions of PHP without the need to program specifically for a MB Module.
Maugrim_The_Reaper wrote:This puts hosts in the position of having to support PHP4 to match user demand since they use applications which cannot run in PHP5, which is again worsened by the population of legacy applications, which of course means few non-professional developers have any public PHP5 access nor a market to work with.
That's why there should be an imperative to support PHP 4 and PHP 5 syntax in PHP 6 to maintain that backward compatibility. This would allow hosts to easily upgrade to PHP 6 without the fear of legacy sites going dark. It won't matter how much better PHP 6 may be if it cannot run PHP 4 and PHP 5 applications. Hosts will not upgrade until they can have some measure of security their hosted sites won't go belly up costing them revenue.

Until such time as close to 75%+ of the hosting companies move to PHP 5 I will not create PHP 5 specific applications. It would be shooting myself in the foot when it comes to the number of potential application users. And I will not maintain multiple branches of any application to support multiple versions of PHP. That way leads to a complete and utter mess. Not to mention the massive waste of time involved.
Maugrim_The_Reaper wrote:That's largely why I think PHP6 will take over from PHP5, but not PHP4.
I think it will all depend upon the backwards compatibility offered in PHP 6. If they scrap any real backwards compatibility to PHP 4 and PHP 5, I think we can see PHP 6 languish in the dark far longer than PHP 5 has when it comes to acceptability. You may even see PHP 5 gain far more acceptance than PHP 6 in that eventuality.
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

arborint wrote:I don't think it's forgivingness ... it's about simplicity. I think OO PHP5/6 has crossed the line that made PHP4 popular.
I remember why I started using PHP instead of Perl for web programming. Everything was built-in and written in C which made it faster. No need to load a Perl module and the dozen files it depended on. To me, OO PHP isn't becoming more like Java, it's becoming more like Perl. That really can't be a good thing for those that want to use OO features of PHP. However, as long PHP6 doesn't change the runtime environment to be more like Java I'll probably feel no impact. [Though I'll probably die of old age before I see PHP6 on a shared server.]
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Buddha443556 wrote:
arborint wrote:I don't think it's forgivingness ... it's about simplicity. I think OO PHP5/6 has crossed the line that made PHP4 popular.
I remember why I started using PHP instead of Perl for web programming. Everything was built-in and written in C which made it faster. No need to load a Perl module and the dozen files it depended on. To me, OO PHP isn't becoming more like Java, it's becoming more like Perl. That really can't be a good thing for those that want to use OO features of PHP. However, as long PHP6 doesn't change the runtime environment to be more like Java I'll probably feel no impact.
I feel the same way ... but I think the impact of things like Zend Framework will make more new PHP code quite a bit more complex.
Buddha443556 wrote:[Though I'll probably die of old age before I see PHP6 on a shared server.]
I believe that PHP6 is essentially PHP5 with Unicode, build-in optimizer and some bad configuration settings finally removed. So I can't imagine that most of the current PHP5 hosting won't upgrade. I think they are hoping that those features are enough to cut into PHP4 hosting.
(#10850)
Post Reply