An Early Look At What's Coming In PHP V6 307
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.
Finally (Score:2, Insightful)
It's about time PHP has native support for unicode.
Time to pay the piper... (Score:4, Insightful)
Re:So... (Score:5, Insightful)
Gotta break some eggs to make an omelet.
Hopefully this will include cleaning up the argument lists of the string and array functions so that they hall take f($needle, $haystack) in a consistent order. Fixing the argument lists isn't in TFA, but it's a really obvious place to start.
At work, it may give me an excuse to rewrite a horrible old app that's been holding us back since the days of PHP4. I suspect I am not alone in wanting to see some old (buggy, slow, insecure, poorly designed) PHP apps get ruined so that they can be redeveloped now that PHP5 is actually a decent language.
Re:Time to pay the piper... (Score:4, Insightful)
You're not far off track. A lot of PHP's problems stems from the fact that the language itself was more or less kind of thrown together rather than planned out (from the early simple Personal Home Page scripting stuff to PHP3 that just kept extending things and adding more functionality bolted on). They only just began to start to stabalize some of that in PHP4 and really only started to fix a lot of issues in PHP5 and now PHP6. They are making good strides but there's a lot of work to do (and a lot of backwards compatible considerations, I'm sure).
The good news for PHP developers with legacy code is that they've had a long time to fix things. Stuff that is going away has been deprecated for many versions now so none of this should be a surprise. The people that will get hit are the site administrators using PHP based apps that haven't been updated in forever.
question: (Score:5, Insightful)
A likely story (Score:5, Insightful)
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.
Limited cleanup (Score:5, Insightful)
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.
My items to be fixed (Score:3, Insightful)
Re:Limited cleanup (Score:3, Insightful)
All I want is for $foo[0] and $foo["0"] to not be the same reference.
One of these things is not like the OOthers (Score:5, Insightful)
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)
Re:Finally (Score:2, Insightful)
Re:question: (Score:1, Insightful)
Well wouldn't you know (Score:5, Insightful)
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.
Re:Namespaces (Score:3, Insightful)
It will print
Hello 3
Because the namespace begins with a backslash ('\foo\n') and when using it inside double quoted strings must be "\\foo\\n".
Re:So... (Score:1, Insightful)
Perhaps your customers freak when they read your spelling.
Re:Finally (Score:5, Insightful)
Ubiquity is a pretty compelling feature.
I mean, BeOS is pretty bitchin', but I'm not spending any of my time on developing applications for it.
Re:My items to be fixed (Score:1, Insightful)
-1 It's a useful language construct with less overhead than exceptions. I'm going to overuse and misuse it out of spite for all those Dijkstra parrots who mindlessly repeat the mantra :-o
+1
-1 Write an extension for carrays.
-1 You can already do this via .htaccess sans security resourse limits which should be per host on shared hosting.
-1 Some of this is already done via namespaces, the problem was extensions like ming that defined rather generic aliases in the global namespace.
-1 PHP already has type hints.
+1 Work to split off all but required bundled extensions into pecl begun some time back.
? I think APC will cache the compiled regex from PCRE?
? You can already do this with cgi, fcgi and there's workarounds (ie: proxy) for mod_php.
Indeed it does not (Score:2, Insightful)
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.
Re:My items to be fixed (Score:3, Insightful)
# Insert optional configurations by project (and not by host);
-1 You can already do this via .htaccess sans security resourse limits which should be per host on shared hosting.
Re:Hope it handles Search/Replace better (Score:4, Insightful)
Loading 88MB file into memory is not going to work by default anyhow, unless you set the memory limit in PHP from the default you will get out of memory errors every time. I think even a find/replace in a Windows app like Notepad or Notepad++ will "work" but it will definitely be slow. When I used to search large logs I would use some sort of file splitter and search each file itself.
And here the rest of us are grepping and sedding multi-gigabyte files without thinking twice. Seriously, what's your idea of a large file?
Re:Well wouldn't you know (Score:5, Insightful)
Stack Overflow has a question from last year titled Worst PHP practice found in your experience?. Earlier today, I submitted the answer whose summary is "The worst practice in PHP is having the language's behavior change based on a settings file."
Great minds think alike!
Re:A likely story (Score:2, Insightful)
It's no defense, but the guy who started PHP, Rasmus Lerdorf, is apparently a Danish Greenlander, and the two guys who rebuilt the parser for PHP3 and on, and founded Zend, Andy Gutmans and Zeev Suraski, are both Israeli. As I said, it's no defense, but Americans didn't have anything to do with creating PHP.
Re:question: (Score:1, Insightful)
It's just a token, people, get over it. There was nowhere nearly as much brouhaha for Python's // operator (that looks like a C++ comment), or the ambiguity of the dot in Java, or VB's \ operator, or the fact that -- in Haskell starts a comment but --# is an operator, and the list goes on.
Re:Object Oriented support in PHP (Score:3, Insightful)
PHP5 has a fairly proper inheritance and member visibility model and is truly reference based (i.e. $objX = $objY means, in PHP5, that they are reference to the same object instance... opposed to PHP4 where $objX = $objY made a FULL copy of the object to $objX).
So they've got to the level of Java 1.0. Congratulations!
Oh, actually, sorry, they didn't, since there are still no namespaces. But there will be soon, and then it'll be at the level of Java 1.0. Once again, congratulations!