An Early Look At What's Coming In PHP V6
IndioMan writes "In this article, learn about the new PHP V6 features in detail. Learn how it is easier to use, more secure, and more suitable for internationalization. New PHP V6 features include improved support for Unicode, clean-up of several functions, improved extensions, engine additions, changes to OO functions, and PHP additions."
Update — May 7th at 16:47 GMT by SS: IBM seems to have removed the article linked in the summary. Here's a different yet related article about the future of PHP, but it's a year old.
It's about time PHP has native support for unicode.
There have been "sneak peeks" at PHP6 for a long time. This is by no means early.
Excuse me while I gather the virgin sacrifice and assemble the pentagram required to solve your problem
without wanting to be overly sarcastic..
What features are they gonne break this time?
All very good. But there is no set release date; I wonder when PHP 6 will be released?
They have been working on PHP 6 since at least 2005, and from monitoring announcement etc., I haven't seen any signs that they are nearing a release.
I am definitely no PHP expert so perhaps I am wrong but it seems that much of what is being changed is backtracking due to bad language decisions from the beginning. Sadly I think PHP developers with legacy code are going to be paying the price for several versions to come.
Play me online? Well you know that I'll beat you. If I ever meet you I'll "/sbin/shutdown -h now" you. -Weird Al, kinda.
How good is the object oriented support in PHP these days?
I haven't used PHP in a couple of years. I gave up because it didn't support object inheritance very well (maybe even at all).
Feedback from anyone who is current with PHP would be much appreciated.
are these ass clowns still planning on using \ for namespaces?
Do you even lift?
These aren't the 'roids you're looking for.
Given that PHP 6 was "rumored" to be out at least a year ago. I can't decide if the title "An Early Look" is meant to be ironic, or is just a sad indicator of progress.
Despite that, I would say that three things have recently happened demonstrating the improvement in quality of PHP:
I would say that (1) and (2) easily are more important for the language than is (3). PHP 5.3's improvements should be a huge change: Namespaces (I know there's a huge amount of hate for this implementation: get over it. It's going to be very useful), Closures / Lambda Functions, and Late Static Bindings in particular make it hard to wait so long for PHP 5.3.
So, stop talking about PHP 6! Lets get PHP 5.3 out.
Nothing about migrations between 5&6 ? and 4&6 ? does it accept old crap code running under the V6 ?
I hope it handles search/replace better. I tried doing a search/replace on a 88MB large string and the stupid script crashed! ;-)
Seriously, though, if anyone knows of any good tactics for large-string searching/replacing, I'd be happy to hear them. My current attempt is multiple page loads in an iFrame while the user is presented with a "working on it..." message.
My sci-fi novel, Ghost Thief, is now available from Amazon.com.
clean-up of several functions
Does that include safe_quote_string_this_time_i_really_freaking_mean_it, or do_foo(needle, haystack) and foo_do(haystack, needle)? At least it gets namespaces after all this time, even if they're almost deliberately ugly.
Dewey, what part of this looks like authorities should be involved?
My items to fix: - Remove the "goto" statement that will be introduced in 5.3 (WHY JESUS, WHY??); - Stardandize function names (current samples: str_replace, html_ entity_ decode, htmlentities, htmlspecialchars_decode); - Improve array speed (for simple arrays, use internally one simple C array/list - current days, any array is a map); - Insert optional configurations by project (and not by host); - Remove function alias; - Provide optional typing for functions and parameters, but in a simple and consistent way (no strange notations); - Remove old extensions, like PDF paid extensions (and please, insert any open and official PDF extension); - As any language, provide a way of store compiled regex, avoiding compile them all the simple regex call for the same task; - Provide legacy support for PHP5 application as separated download (or at least allow PHP6 and 5 in the same host - we suffer a lot to find PHP5 Hosting in the earlier times, due the impossibility of run PHP4 and 5 at the same host).
So let's say you've got a global variable, $n
And let's say you're using it in a module, Foo
And because scattering global variables everywhere is a stupid idea that will lead to much pain, let's say you've decided to use namespaces in PHP6.
Now, in your main script, let's say you happen to be using a variable $Foo, for no particular reason.
What does this do?
<?php
echo "Hello $Foo\n";
?>
$x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
$x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
One of these things just doesn't belong
python:
myArray.append(myvalue)
ruby:
myArray.push(myvalue)
objective-c:
[myArray addObject: myvalue]
smalltalk:
myArray add: myvalue
PHP:
array_push($myarray, $myvalue)
In the finest tradition of PHP, they made Unicode behaviour dependent on a setting. Have these people learnt nothing from the past? magic_quotes anyone? Bleh. All languages have their warts, but the amount of bad design decisions in this one is just staggering.
There is an ArrayObject class in PHP http://us2.php.net/manual/en/class.arrayobject.php
But like a lot of the stuff in the SPL, no one ever uses it (including me). I'm not sure why.
Now we've made it impossible for stupid people to turn on register_globals - instead if you try to turn it on you get the message ERROR(Id-10-T) -- PHP-RTFM.
Link in original article is returning 404. I think this is it: http://www.ibm.com/developerworks/opensource/library/os-php-future/
Staying up to date is part of doing business. Would you use a cab that still used horses? Get on a steam train with open box carts?
While progress for progress sake can be overrated the simple fact is that we learn from mistakes and improve on the stuff we make. There comes a time when being conservative turns you into a technical ludite and as a tech company you got to ask yourself, is this worth it?
Is there a business in supplying coal for instance? Some people still heat their houses with it, but does that mean YOU as a business man have to run a business to supply them?
Ask yourself, how much time does it cost you to keep the people happy who want PHP4 and how much that same time could have earned you in business from PHP5 customers.
Go into your local shopping district and you can probably find stores that still cater to people who haven't moved on, who still do their shopping at the corner store. It is quit fun actually, but who would you rather be. The owner of a corner store struggling each day to pay the bills, or the founder of Albery Heyn, the corner store that made it big?
The hardest thing a good business man has to learn is to learn which customers to let go.
MMO Quests are like orgasms:
You may solo them, I prefer them in a group.
The article got thankfully pulled by IBM already, to correct a number of in-accurate statements *hopefully*
they have actually turned off the register_globals feature (really this time it won't work). If you try to use it you get an error message that says RTFM (ERROR: ID-10-T)
"i lost my dignity on a slippery wiener"
Market share: PHP 50%, ASP 49%, rest perl.
When PHP and ASP don't totally dominate the job listings, please come back to me again. In the meantime I know which of the function calls pays for my food.
Oh and $array[] = $value;
Coding, you should learn it.
MMO Quests are like orgasms:
You may solo them, I prefer them in a group.
So the "major" new features of PHP6 are UTF-8 and Namespaces. With a horrible \ delimiter. Yawn.
C# and VB have had UTF-8 and Namespaces for many years. Meanwhile C# and VB in .NET 4.0 are getting dynamic keyword support, anonymous methods (VB), co- and contra-variance, automatic properties (VB), and "From" keyword list/dictionary initialization (VB) as soon as this year. And I'm not just crooning for Microsoft, either. Python has shown much more improvement than this over the years.
I was hoping after the poor OO implementation of PHP5 that PHP6 might incline me to develop in it again, but after seeing this, no thanks.
Until they throw out ZE2 and redo a new ZE3 most or all of the features of php6 are going to feel hack-ish.
Classes are not a first-class data type, so you will never be able to do real casting:
$mouseEvent = (MouseEvent)$event;
I wish someone would port php6 over to parrot or python runtimes. I've contributed to extensions for both PHP and Python (qt, pygame) and Python's engine source code is 100 times easier to understand.
All languages have their warts, but the total lack of design decisions in this one is just staggering.
Breakfast served all day!
...I've moved away from PHP!
Most other platforms are fairly secure as long as you don't mess up. With PHP it's the other way around - you've got to be extra careful with every line you write because there are possible holes everywhere.
Take email header injection for example - with PHP this is actually a real problem that you as a developer have to care about. On other platforms, with sane APIs, this would never be an issue.
To really fix PHP, every existing application would have to be broken. And I'm not being sarcastic or trying to make a joke. I use PHP myself for a lot of projects, but this is one of those languages where you really can't make excuses: it's just broken, and fixing it would require changing the language in ways that would break every existing app.
Bad timing :)
RC2 just came out link
I have credible sources telling me that the Duke Nukem Forever site will, in fact, be written in Perl 6. Furthermore, DNF's mod scripting system runs on Parrot.
PHP: its like fast food..
You know its bad for you...
You feel like crap after eating it...
But damnit, its right there, oh so conveniently located on the way to work, and sometimes a greasy cheeseburger just hits the spot, even though you know you'll pay for it later in heartburn and much later in high cholesterol and love handles, even though right now its really cheap on the wallet.
Its a guilty pleasure.
And while you're sucking down that greaseball burger, you see the local soup and salad restaraunt and think "next time, I'll eat right.."
But come the next day and you see that taco joint and..
-- Senior Software Engineer, Attorney appearance services, locallawyerapp.com.
Will PHP6 finally support easy-to-make upload progress bars? Because with PHP5, unless you have total control over the server, it's almost impossible to do.
And all the "hacks" I've seen so far are Perl script who never seem to be doing their job on the servers I test them on (the files do upload but the progress bar never updates during the actual uploading of the file).
It's been broken over all for years now. I'd try to do:
use strict;
and it always fails. WTF? :P
Karma: Chameleon (mostly due to the fact that you come and go).
So here is the correct TFA address
I have been hoping (and reading that) the coming PHP6 would arrive with a built-in PHP accelerator APC - is it? Or is there a silent change of plans?
I would love to see JavaScript on the server side. It's already way more powerful than php5 with (superior) prototypal oo, higher order/first class functions and many other meta-programming abilities.
All it needs is some good libraries. There are people already working on this. Soon... soon.
I develop PHP applications for a living and all I can say is, why bother?
If was to fix PHP the result would be practically like python, but that would be incompatible! But PHP6 will be incompatible anyway, what's the point?
For new projects I recommend any other tool, I'd say Django or Rails but even ASP could do better.
For legacy applications you can't switch to PHP6 or the legacy code will fail.
But... the future refused to change.
Briefly: Damn this isn't the right address
Longer version: Original TFA link didn't/doesn't work and the firefox didn't find on this page strings "URL" or "address" for pointing out the correct article link. BUT I saw that "working link"-post... So I read it and see nothing of APC is mentioned there( which is the most expected thing for me on PHP6). So... in doing a public a favor I repost the above "year old link" and wonder about APC. OK, the link isn't right thus there's still hope for APC to be there - maybe & sorry.
here's the correct one: http://www.ibm.com/developerworks/opensource/library/os-php-future/
When I try and open the link on TFS, I get an error to the effect that it can't be displayed. Then I did a search for "php v6", and clicked on sort in descending order, and the first entry is dated to 21 december 2015.
Our apologies...
The page you requested cannot be displayed
Suggested actions
* If you are looking for IBM Systems or Grid computing content on developerWorks, that content is no longer available. We suggest that you visit the following links for related content: IBM Systems, Systems, servers, and storage, or IBM Grid computing.
* If you typed the address, make sure the spelling is correct.
Note: Most addresses are also case sensitive.
* If you clicked on a link, there may be a problem with that link. You can use "Get assistance" below.
* To navigate the IBM developerWorks Web site, start from IBM developerWorks.
* Use the search box at the top of this page.
* Or return to the previous page.
"Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
C++ does have classes, integrated associative arrays (std::map), variable-length arrays (std::vector) and usable string manipulation (std::string). STL components are a standard part of C++. Then, together with the Boost library, you pretty much have everything that the PHP runtime library has.
There are reasons why PHP has popularity over C++, but these technical issues aren't it.
I avoided PHP as long as I could, finally was compelled to give in and become proficient in it. Now I want to dig out those parts of my brain that know about PHP, and particularly those that store memories of the miseries I've experienced in dealing with the work of "coderz". Dig them out with a spoon that's seen a few laps around the garbage disposer and hasn't been washed since.
Give me Perl, mod_perl, and Catalyst any day.
Warning: This signature may offend some viewers.
The funny thing is, Perl apps that were written ten or even fifteen years ago still work. PHP code that was written LAST WEEK is already broken.
For all those people complaining about PHP 4/5 issues.. really?, REALLY!? Not to sound like a troll here, and KARMA aside,but cmon. There are not that many changes at all that can't be fixed even on huge applications.
...
............done: 44,133 bytes
Haven't any of you people heard of php_compat? Simply install PHP_Compat library from pear:
#pear install php_compat
downloading PHP_Compat-1.5.0.tgz
Starting to download PHP_Compat-1.5.0.tgz (44,133 bytes)
install ok: channel://pear.php.net/PHP_Compat-1.5.0
Then in PHP
require_once 'PHP/Compat.php';
PHP_Compat::loadFunction('file_get_contents');
This should solve your integration issues with PHP5. http://pear.php.net/package/PHP_Compat
Who goes to Cheapscum's Ratburgers when there's a Burger King next door?
That would be like using PHP when Perl, Python, and Ruby are all just as quick, just as easy, far better designed, and far more conducive to writing robust and maintainable code...
Then you'll be sorry
I first wondered IF I want to actually read about it
then I said what the hey, lets look at it, know your
enemy and all that.
All I get is an IBM Notice:
Our apologies...
The page you requested cannot be displayed
Suggested actions
If you are looking for IBM Systems or Grid computing content on developerWorks, that content is no longer available. We suggest that you visit the following links for related content: IBM Systems, Systems, servers, and storage, or IBM Grid computing.
If you typed the address, make sure the spelling is correct.
Note: Most addresses are also case sensitive.
If you clicked on a link, there may be a problem with that link. You can use "Get assistance" below.
To navigate the IBM developerWorks Web site, start from IBM developerWorks.
Use the search box at the top of this page.
Or return to the previous page.
Get assistance
To tell us about a broken link, go to the IBM developerWorks Feedback page.
404 Not Found
My Karma isn't excellent, damn it! (And
That would be like using PHP when Perl, Python, and Ruby are all just as quick, just as easy, far better designed, and far more conducive to writing robust and maintainable code...
Not quite, particularly Python and Ruby. There are several ways in which PHP tends to be convenient, and they're all about easy availability. Or as they say in the real estate business, location, location, location.
1) PHP is on very nearly *every* general Unix hosting package, and most Windows hosting packages. Python and Ruby interpreters may or may not be on the system... much less the popular frameworks. Perl's pretty much everywhere Unix as well, so there's a kind of parity for it, but...
2) You don't need your files in some particular layout or in some weird cgi-bin directory. If it's got a .php extension on it and is in the web server's document root, it gets run.
3) You can just sprinkle it on in with the HTML output it's part of, especially convenient if it's just a tiny, little bit of logic in a sea of markup, right?
None of this is to say anything about PHP's general suitability for web applications (hey, you know you've got it bad if *Perl* is beating you out for conducivity to writing robust and maintainable code ;) ... just to point out why it's often easily and sleazily convenient in a way the others aren't.
Tweet, tweet.
the link is broken?
How is it that php is already putting out version 6 but we've been waiting forever for Perl 6. C'mon Larry, put it out already. I'm afraid I'll be playing Duke Nukem forever and watching Boondock Saints 2 before Perl 6 comes out.
and replace it with the "spaghettiscripting" tag?
Because after having to use it for 5 years at my job, and having used many real languages at home and at other jobs, I must say that that is all it is good for.
The interpreter itself is a total joke. Just as bad as the code it interprets.
I could manage to do things like put random clear text in the middle of the code (where a statement should have been. And the interpreter did not even complain or notice.
put a simple string without quotes of any kind inside an expression, and PHP acts as if it were a proper string. Of course it even gets hairier, when the whole automatic number-string-conversion comes in. And the each() "function". Heck, it seems not even the developers know the difference between a reserved word, and a function. And most "programmers" who use it, seem no not care that "if" is not a function. They write "if(something) { bla }" but "somefunction (parameter)", as if it were a reserved word. I have even seen it in the documentation for PHP itself. There is so much madness in that thing, that I would deny a job offer, just because this were their language of choice.
And don't ask me about the PHP5 in-class special methods (the ones starting with "__"), because I might pull my hair out, when remembering how just plain wrong the concept of them was, when trying to implement standard features, that PHP somehow just didn't do.
It is simply unnecessarily hard to code properly in PHP. So why do it at all? It has no benefit over Python, JSP, or Ruby. Which in my eyes leaves no reason.
Any sufficiently advanced intelligence is indistinguishable from stupidity.
http://www.ibm.com/developerworks/opensource/library/os-php-future/
The link is bad. Try: http://www.ibm.com/developerworks/opensource/library/os-php-future/
Wow, we slashdotted IBM, the biggest server company in the world. That's like beating the Lakers, Celtics, and Cavaliers all in one day.
Table-ized A.I.
I saw this. It requires you to install an engine to your web server (like Tomcat).
http://aptana.com/jaxer