The Digg Crew wants to hear your thoughts!
Please take our short survey about Digg and potential feature ideas.
Taking a look at PHP 6
jero.net — While most web hosts are still in the PHP 4 era, the PHP developers are already planning and working on PHP 6. This article is taking a look at what's been planned for this future version of PHP.
- 889 diggs
- digg it
- TLLOTS, on 10/12/2007, -0/+10If you want a more indepth look at what is being changed for PHP6 and the reasoning behind the changes, take a look at the below link. Some parts are a bit out of date now, but it still makes for a good read.
http://www.php.net/%7Ederick/meeting-notes.html- headswine, on 10/12/2007, -2/+1There are still lots of problems with php5.That's the issue. The move to passing parameters by reference by default was a good thing, but broke a ton of old code. It has cost us a fortune to switch.
http://www.presenternet.com
- headswine, on 10/12/2007, -2/+1There are still lots of problems with php5.That's the issue. The move to passing parameters by reference by default was a good thing, but broke a ton of old code. It has cost us a fortune to switch.
- headzoo, on 10/12/2007, -0/+3Unicode and namespace support. Thank you God! Everything sounds great, but like the author said, for some damn reason many hosting providers are still using PHP 4.
Anyway, a lot of this is fantastic news.- The_Decryptor, on 10/12/2007, -2/+2Yes!, finally.
been needing this. - ForbesBingley, on 10/12/2007, -1/+2Because PHP5 breaks lots of stuff in PHP4, namely object-oriented stuff.
PHP5 is a lot more strict, so some PHP4 stuff can get a kickin'.
I've got an entire application framework I've developed that still doesn't work well with PHP5.
I'll be honest, I've been somewhat remiss in my house-keeping chores, but there's over 90k lines of code to sift through... - headzoo, on 10/12/2007, -0/+2array_merge() changed in PHP 5, and that foo bared a couple of my apps. But I wish more hosting providers would provide both PHP 4 and PHP 5, like some of my host do.
- salmonmoose, on 10/12/2007, -0/+2i'm pretty sure it's all array functions, I've just ported a bunch from 4 to 5 and 95% of the errors were from passing undeclared arrays to array functions, (and foreach) often, you can do a quick and dirty if($array) before the statements.
- drakethegreat, on 10/12/2007, -0/+1This has a lot to do with PHP4 code breaking in PHP5 as previously mentioned but most people seem to only think about code in the sense that the person has the ability to port it. The situation I have ran into (running a small hosting company of my own) is that 3rd Party scripts are the issue. A lot of vendors are just now porting code to be ran on PHP5. For awhile scripts like Invision were holding me back from upgrading but a few months back I upgraded and told my customers that it was a trade off to go with either version and if it broke their scripts either upgrade, rewrite if its their's or find something better that has been upgraded (since the script in question is probably from a dead project).
Anyways I think its cool they are making another version of PHP since it will come with awesome new features but I stilll wonder if its rushing things. I know others feel the same. I feel the PHP development process moves way too fast. Considering projects like Linux and Apache are on a major version of 2 rather then 6. It also seems that each major release results in sweeping changes like that of apache 1 to 2 and it affects everyone majorly when they do that sort of thing. Honestly I have been using PHP for 8 years myself since version 3 and I would start to consider switching to another technology like ruby on rails if they rush PHP6. I prefer not to have to deal with these issues since it was only a few months ago that I finally didn't have to deal with the PHP4->PHP5 issue anymore. - panic, on 10/12/2007, -0/+1I use a2webhosting.com which has PHP4 and PHP5 support (with cpanel). I used to use AffordableHost, but last I checked they only provide PHP4
- automagically, on 10/12/2007, -0/+2I guess the hosts are afraid of people complaining of broken scripts. I wouldn't wanna lose my customers either. If it isn't broke, don't fix it! However, PHP5 has been out for a long time, so time to shift blame.
- sproutworks, on 10/12/2007, -0/+2As a few people have pointed out, some hosts support 4 and 5. Mine does (dreamhost, which has lots of other nice things). They have a control panel where you can choose 4 or 5 for each domain (you can host unlimited domains). I can even compile my own PHP and use that if I want to.
The hosts running only PHP 4 should be able to figure out how to run both versions. Saying PHP 5 breaks scripts isn't a good excuse not to upgrade since using both is doable.
- The_Decryptor, on 10/12/2007, -2/+2Yes!, finally.
- prockcore, on 10/12/2007, -2/+5Great.. looks like I need to buy the white album again.
er.. I mean I need to rewrite some of our more prominant scripts.- krewemaynard, on 10/12/2007, -0/+2i get the feeling 80% of diggers have no clue what the white album is, much less why they'd have to buy it again :) well played
- slack31337, on 10/12/2007, -0/+1Don't buy it! MJ will use the profits to build another neverland
- bosmonster, on 10/12/2007, -1/+1Based on some old meetingnotes we've known about for quite some time...
Reliability-- - Haplo, on 10/12/2007, -2/+1PHP 6. I can only ask one thing: Make it run on Parrot.
Yeah, I keep on dreaming. - Syntaxis, on 10/12/2007, -3/+4PHP6: now with "BuildEasyWeblog('name')" function to make life even less troublesome for the *real* webdeveloper!
/sarcasm ;-)- raisenero, on 10/12/2007, -0/+4An overloaded function also takes age as a parameter.
age < 16 - it automatically posts "child predator"-like comments everytime you update it. Eventually it actually kidnaps you.
age 16 to 25 - Any post you make is overly dramatized, every aspect of your life is made to sound critical and life threatening complete with mention of periodic suicide attempts.
age > 25 - Every post is automatically given a "desperately clinging to youth" tone. The weblog generator searches the internet for 6-month old trendy phrases, electronics, and places, and inserts amusing anecdotes about them into your posts.
- raisenero, on 10/12/2007, -0/+4An overloaded function also takes age as a parameter.
- energeek, on 10/12/2007, -0/+2lets hope all the global functions are grouped into namespaces too.
- TLLOTS, on 10/12/2007, -1/+1Unfortunately I don't see this happening with PHP 6, simply due to how much it would break. Perhaps in PHP 7 they'll introduce it with a compatability layer with the functions in both the global namespace and their own seperate ones so people can slowly migrate. At least that's what I hope, it would certainly go a long way towards solving the issue's some have with PHP, though PHP 6 will put a fair dent in that on its own.
- Haplo, on 10/12/2007, -0/+1"Unfortunately I don't see this happening with PHP 6, simply due to how much it would break."
Simple solution, let PHP find out if it's running true PHP 6 or an older version. Stuff like this can be solved with pragmas.
- Seumas, on 10/12/2007, -0/+1Cool. This should make it into Debian/Testing before the end of the Mayan Calendar in 2012.
By the way, as someone who uses neither Ruby nor PHP -- I was just pondering why one would choose one over the other if they were doing essentially web work most of the time with it.- TLLOTS, on 10/12/2007, -0/+1Unfortunately I can only speak as a PHP developer so you'll have to forgive my bias ;) However, it largely depends on what you're intending to do. If you're just writing web apps for yourself then it's a matter of personal preference, however if you're potentially going to be maintaining other peoples work, then you're more likely to find yourself working with PHP since it is far more widespread than Ruby. In any case though I'd really recommend giving both a spin, as I'm presently doing, downloading Ruby right now in fact :)
- dasch, on 10/12/2007, -1/+1I have used PHP for about 4 years. A few years ago I tried out Ruby - and I've never written an app in PHP ever since. Ruby's just that much more - it's an actual programming language, not just a collection of scripts.
Furthermore, it embraces its dynamically typed nature, instead of hiding it with Java syntax like PHP does. - Seumas, on 10/12/2007, -0/+1I'm a perl guy, but that is really the only language I know to any depth. I was considering Ruby for a more structured experience. Perl is great, but when it's almost all you know, I find it is easy to do things "the wrong way" or toil for eons over something that might be obvious in another language. So I was looking for another language to do some of my project in to compliment or possibly replace my Perl usage.
I know that PHP is very web-ish, but I don't know how I would feel about using it. I like that I can do my web work in perl. And my background work in perl. I can use Perl in every layer of my project since it's not intended for any one specifically.
My only concern has been that if I went with Ruby, I don't know if their DBIs are as thorough and strong and flexible as the perl DBI. That's one thing that I found annoying about toying with PHP a bit. Everything is geared toward PHP+MySQL. But I'm a postgresql guy and found that (at least as of a couple years ago), postgresql got the short end of the support/API stick. - jiscariote, on 10/12/2007, -0/+0Debian policies are religious and broken, that's not a PHP problem I think :-)
that's one the reasons why people is more and more using Ubuntu or any other thing..
- Rickard, on 10/12/2007, -0/+1Old news, but no more register_globals/magic_quotes/safe_mode and opcode caching by default == sweet. And proper unicode support of course.
- rautox, on 10/12/2007, -0/+1see below
- r©ain, on 10/12/2007, -0/+2I figure they'd try to get namespace support in, that was a much touted feature of PHP5 -- that got yanked a few months before RC1.
And yes! magic_quotes are something I've always disabled and have never understood why the hell anyone would want that. Need character escaping? addslashes and addcslashes are the tools for the job.
But namespaces... I've yet to hear a whole lot about what namespace support actually means in PHP. I would assume a packaged class structure at class include and registration time... But I'm really hoping they'll add an import declaration like Java, it would be nice to package class libs up and load an entire package with one import statement. Anyone have some info on that?- casiotone, on 10/12/2007, -0/+0psst.. http://uk.php.net/manual-lookup.php?pattern=escape_string&lang=en
Don't use addslashes :)
- casiotone, on 10/12/2007, -0/+0psst.. http://uk.php.net/manual-lookup.php?pattern=escape_string&lang=en
- cbeach, on 10/12/2007, -0/+0What PHP desperately needs, IMO, is support for application-scope variables. This would enable a whole raft of functionality like in-memory chatrooms, bespoke caching systems etc.
It's one of the principle omissions that separates PHP from enterprise languages like Java and ASP.NET.- headzoo, on 10/12/2007, -0/+1Can't say I agree with you. Especially when you make it sound like it's something PHP is lacking, when in fact it was likely left out on purpose. You can emulate application scope variables with sessions, files, and databases though, if it's something you really need.
- TLLOTS, on 10/12/2007, -0/+0Actually for the tasks the parent specified (chatrooms for example), using sessions or the database is simply not feasible as there's far too much overhead. Application scope variables would largely resolve this issue and simplify a lot of otherwise difficult tasks with PHP. Sadly it doesn't seem to be on the cards for anytime soon.
- ashanks, on 10/12/2007, -0/+1Yay! No more register_globals problems! No more magic_quotes problems!
And then there's some nifty new changes as well.
Thank you, PHP devs. :-) - HvitRavn, on 10/12/2007, -0/+1*sigh* removing magic quotes is going to cause me alot of headache. I should just start fixing it right now.
- casiotone, on 10/12/2007, -0/+0You should have started fixing it ages ago, or never used it in the first place. Magic quotes causes people who write proper code more headaches than you.
- RyanBrooks, on 10/12/2007, -0/+0Personally, most of this stuff shouldn't affect those of us that understand PHP well enough to avoid Reg Globals and Magic Quotes...
What I'm looking forward to most is File Info - though it's in PECL, I agree that it should be a core distro. Mime Magic simply sucks when you're trying to do anything useful - JPEGs coming out as Microsoft Excel files... Oi. - prose, on 10/12/2007, -4/+0Why would a webhost bother to upgrade? I won't.
http://www.linkdump.com - parttimeuser, on 10/12/2007, -3/+0I want ASP's Response.Redirect().
- andreizilla, on 10/12/2007, -0/+1header('Location: http://php.net');
- usidoesit, on 10/12/2007, -2/+1PHP == discontinuous language revision every 3 months.
I'm so tired of keeping up with PHP. I've stopped at 5.0.4 and will not go further...switching to Python anyhow, tired of the mess. - jiminoc, on 10/12/2007, -0/+1any credible webhost will offer to at least roll your own version of PHP. PHP5 is lightyears beyond php4. The xml support, built in SOAP Ext, and OOP changes are worth it alone. If your host doesn't offer you the ability to add php5 then you have a ***** webhost that likes the bare mimimum. Thats the bottom line. To quote office space "Now what do you think of someone who only likes to do the bare miniumum? You do want to express yourself don't you??"
- panic, on 10/12/2007, -0/+1Not enough providers have PHP5 support, but even more rare is MySQL5. I would like to start using stored procedures and other new techniques in my PHP applications. Does anyone know of any hosts that have PHP5 and MySQL5 (preferably with cpanel)?
- sproutworks, on 10/12/2007, -0/+1Dreamhost has PHP 5 and MySQL 5. They use their own custom control panel though. It seems to do everything that cpanel does, but I haven't used all the cpanel options.
- headzoo, on 10/12/2007, -0/+1Yep, Dreamhost has the most current versions of both PHP and MySQL. You'll have to "turn them on" though, as they are not the default.
- thecwin, on 10/12/2007, -0/+0Not sure if PHP has these now, but it didn't last time I used it:
- Lexical scoping
- Strict variable types
- Good fatal error handling
Of course, strict variable types doesn't destroy the ability to do dynamic typing, it could just be done in a safer, more explicit manner, and it would allow for things like overloading. I suppose I should probably just use Java, but I did like the idea of PHP (as in, being quite simple, not scarily overcomplex with web application related stuff, but just scripts).
Also something else that would be nice would be some sort of PHP registry-type setttings storage class thing. It's so annoying to have a server of loads of small PHP components that you have to configure all manually in different ways. Can't remember how, but I remember that including/requiring files was always a bit strangely behaved too (maybe if it could be called from more than one filename or something).- headzoo, on 10/12/2007, -0/+1Hmm, not sure what you mean by strange behavior with include/require. I can tell you that PHP 5 as the new __autoload function that relieves a lot of the headaches of including a lot of scripts.
- Teh_Psyren, on 10/12/2007, -0/+1I read this the other day on the RSS feed. ;)
- catoutfit, on 10/12/2007, -0/+1hmmm I wonder if => will be dropped in favour of .
and + used for concats instead of .?
Doubt it, but it'd be nice/break everything. - corexian, on 10/12/2007, -0/+0The kicker is PHP 4 and 5 can be run side by side. It's rediculous how many hosts don't support version 5 yet. There are COUNTLESS tutorials out there on getting the hosting environment set up for this, too.
I'm another who actually likes the latest of version 5 . . . - ctheory, on 10/12/2007, -0/+1Very cool read. Diggage.
- headzoo, on 10/12/2007, -0/+1I wouldn't mind dropping the $this-> and self:: from inside classes. That would be a nice change.
- proph, on 10/12/2007, -1/+0Cool read indeed.
- rocklv, on 10/12/2007, -0/+0Would PHP6 be the final version? I don't want to handle over PHP4/PHP5/PHP6 at the same time. That's crazy!
- jiscariote, on 10/12/2007, -0/+0I don't think so, In fact, PHP4 is very likely to be declared unsupported by PHP folks, and that , will force vendors to upgrade at least to PHP5, and in a short period of time, that also will force people unlikely to do so :-)
software have a life cicle, and you have to live with that.
- jiscariote, on 10/12/2007, -0/+0I don't think so, In fact, PHP4 is very likely to be declared unsupported by PHP folks, and that , will force vendors to upgrade at least to PHP5, and in a short period of time, that also will force people unlikely to do so :-)
- magnetik, on 10/12/2007, -0/+0It would be wise to have a good read of those meeting notes referenced in that article - to be a little "future proof"
http://www.php.net/%7Ederick/meeting-notes.html
Quite a few other PHP6 changes which will effect quite a few people - such as the removal of {} brackets to extract specific characters from a string and rolling back to [] brackets. I know this will play a bit on some of my current code since I use curly brackets quite a bit for that purpose. Time to switch to []'s :) - v3xt0r, on 10/12/2007, -0/+1hmm, this would make PHP5 pretty much pointless. It would also make PHP6 pretty pointless, as most hosting companies and existing web applications are not compatible.
Here where I work, I maintain a 6yo codebase that consists of PHP3, PHP4, PERL, and Python.
The codebase is approx: 3000 files.
After doing a compatibility analysis, I found that only 1 deprecated function is in use (array_merge()), however, it occurs throughout the codebase over 500 times, all with different variables called.
I'm still working on a sed script to fix this, but the network admins are very very hesitent to upgrade to PHP5, anytime soon. *even after I resolve deprecations*
Digg is coming to a city (and computer) near you! Check out all the details on our