PHP6 - A look ahead

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
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

d11wtq wrote:I already have two installations with the config files set to bind to different IP's but I just get an error that the PID file aready exists when I try to start the second one :(
I gave up using the source I had... make clean seemed to break a few things and it all went downhill from there but it's working now with a newer HTTPd version. Quite handy to have anyway since I can use one as a test/experimenting server :)

PHP6 at this early stage is still pretty much PHP5... even the file names still refer to "php5" (libphp5.so), but some things are already working as listed above from the changelog... it'll be interesting to keep pulling in the latest CVS snapshot and watch how this changes :)

http://php6.w3style.co.uk/phpinfo.php
hash support enabled
Hashing Engines md2 md4 md5 sha1 sha256 sha384 sha512 ripemd128 ripemd160 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru gost adler32 crc32 crc32b haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

psst, "hash" has been there since at least 5.1 ;) (Built-in as of 5.1.2)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

feyd wrote:psst, "hash" has been there since at least 5.1 ;) (Built-in as of 5.1.2)
Has it? :oops: I didn't realise it was there up to SHA512. Interesting... never noticed that before.

EDIT | Ahh... maybe that's because I've been using 5.0.4 :P
Gambler
Forum Contributor
Posts: 246
Joined: Thu Dec 08, 2005 7:10 pm

Post by Gambler »

They did so in php3 and php4, and doing so resulted in *thousands* of apps having to be recoded to include/require/etc files with .php3 to .php4.
As I noted before, my hosting provider currently uses extensions to separate different versions. They did so because it does not break anything, at the same time allowing clients to use new language features. If script is written for PHP 4, then its extension is "php", and it is executed by PHP 4 engine. If script is written for PHP 5, than it's extension is "php5", and PHP 5 engine is used. The only case when you have to rewrite something is when you want an old system to run under new engine. That is truly rare case. People who have perfecly working PHP 4 websites do not want to upgrade. They don't care about new features, because their systems do not use those features anyway. For them, upgrading would just cause unnecessary headaches. On the other hand, people who want new features simply write their cripts for PHP 5. This is a win-win situation.
Its entirely valid to suggest to someone complaining about a situation to try to improve it.
You're not suggesting me to improve situation, you're suggesting me to stop discussing situation. There is a difference.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

Gambler wrote:If script is written for PHP 4, then its extension is "php", and it is executed by PHP 4 engine. If script is written for PHP 5, than it's extension is "php5", and PHP 5 engine is used.
I rarely say this, but do some research, and look up the history behind php3/php4, and you'll understand why it breaks *everything*.

Having been through the php3/4 transition, they made the right choice.
Gambler wrote:The only case when you have to rewrite something is when you want an old system to run under new engine. That is truly rare case.
Thats not at all rare case. The majority of users want their apps to work on current releases. Or did you forget that php4 is only in maintenance cycle (no new features), and php5 is the current release?

Adding additional hurdles (like forcing all apps to rewrite every include, and require statement, and rename every file) to upgrade means no one will!

Thats not at all a win-win. Its a bandaid that gives people a reason not to upgrade. Its been done, and it was a nightmare. Read up!
Gambler wrote:
Its entirely valid to suggest to someone complaining about a situation to try to improve it.
You're not suggesting me to improve situation, you're suggesting me to stop discussing situation. There is a difference.
I'm suggesting that you don't know the history, and for a good reason, and as a result, your comments are uninformed. Being involved and coding (as the php internals team is) might give you a refreshing view of their reasoning, and possibly an education. Short of doing either, at least read up on what happened when they made the same decision you are suggesting, several years ago.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

I have difficulty conjuring what exactly my google search term would be. "php 3/4 fiasco"? "php extension name problem" "php developers made hard choice in php 3/4". Enlighten us. (playing devil's advocate here... I'd be interested in knowing about the history... but not necessarily wade through years worth of mailing list posts and staff minutes)
Gambler
Forum Contributor
Posts: 246
Joined: Thu Dec 08, 2005 7:10 pm

Post by Gambler »

I'd be interested in knowing about the history.
Same thing here. By the way, I always thought it would be nice if PHP had an official source of information on such topics. Something that would describe the history of PHP design, and why it is the way it is. I even proposed something like that on their mailing list, but there was no reaction.

...

Going back to the topic of PHP 6. What namespace separation sign did they settled on? ":::"?

And is there any sign of someone fixing the new problem (new ClassName()->function())?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Both of you (Roja and gambler) stop arguing and/or instigating each other. I really don't want to lock this thread.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

It is interesting to hear that people don't know the history. For those that remember, PHP3 scripts had the extension ".php3". With PHP4 they went to the ".php" extension. (PHP/FI used ".php" but because so few people used it it was not an issue) PHP3 had a user base and PHP4 had a much larger one -- but the extensions were different. The main point is that the PHP4 -> PHP5 transition is the first one with a large user base where the extension did not change.

Additionally, I recall that you could run PHP3 and PHP4 concurrently as Apache modules. PHP4 and PHP5 cannot be as concurrent modules. I also recall that there also were upgrade scripts in the older versions that would do basic syntax upgrades of scripts.
(#10850)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Aha.

PHP 3 = .php3
PHP 4 = .php
PHP 5 = .php
PHP 6 = .php (projected)

(I was actually dimly aware of this fact)
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Yep, so PHP4 to PHP5 was really the first transition where the extension did not change. And everyone has an opinion of how that transition went.
(#10850)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

So... what happened when the .php3 to .php switch happened that made it so undesirable?
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

Ambush Commander wrote:So... what happened when the .php3 to .php switch happened that made it so undesirable?
Imagine having to rename the extension of every file your application includes. Now do so in the code of every file, since include()'s and require()'s use filenames.

Now repeat the process for every php application ever made.

Or, in the alternative, as an application maker, choose not to do "all that work", and just keep on using php3 files.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Ambush Commander wrote:So... what happened when the .php3 to .php switch happened that made it so undesirable?
You'd have to go back through the lists to get the tenor of the discussion, but I think they saw the version number on the extension as unbecoming. Other professional languages (like Java) didn't do it and PHP wanted to be a big boy.

It also made sense to have different extensions because PHP3 and PHP4 were different languages -- in the way C and C++ are. The problem in hindsight is that PHP3, PHP4 and PHP5 are sort of like C, C++ and C+++. PHP also seems to be different because it was not designed at a big company or by a purist like most languges are. It is probably more like Perl in its evolution than C#, Java, Ruby or Python.
(#10850)
Post Reply