Right now the most stable version of PHP is v5.3.6 released on march 17, 2011. PHP is powerful web language which has a big community support. The most beautiful part of PHP is that it costs you nothing to download and you will get millions of tutorials and books to learn PHP. It first appeared in 1995 and since then it has gone through a long journey with many changes. Recently I found out that PHP is releasing its version 6 in the near future, as expected it will have many changes as compared to its previous version. The most expected changes are listed below.
Remember whatever you read here is only a prediction and not 100 % proven. We can only be sure when the actual end result , that is the final version 6 of PHP is released.
Register Globals most likely to be removed
This setting in file PHP.ini is a major security problem with PHP if turned on. This setting when turned ‘On’ tells to register the contents of the GET, POST, COOKIE, SERVER and Environment variables as global variables.
For example, http://www.xyz.com?name=joe will set $name as a global variable without any coding. That’s a really huge security risk and if removed in v6 will be highly praised.
Magic Quotes will also be removed
The three major function magic_quotes, magic_quotes_sybase and magic_quotes_gpc are introduced for newbies to write SQL commands without the requirement of manual escaping. This was a mistake done by inexperienced developers more frequently and caused a lot of security issues.
String Indexes { } and [ ]
It is expected in version 6 the value of string’s character at a specified position cannot be referred by using { }. In PHP 5 it generated warning messages. The only usage will be the standard array position syntax, [ ].
Unicode Support in PHP
Presently in PHP, Unicode is accessed on per request basis. It cannot be used globally and hence it uses more resources. It is expected that this issue would get fixed in the much awaited PHP version 6.
var same as public
In PHP v6 ‘var’ will be an alias of ‘public’ and will not show any warning.
Any return by reference will generate warning
For example function &xyz will generate warning.
Similarly $ab = & new Exclass() will generate a warning as well.
Other possible changes
– There will be no safe mode
– E_STRICT will be merged into E_ALL
– Ternary operator ‘?’ will work as below
$x = $_POST[‘name’] ?: ‘joe’ i.e if $x is true, $x will be equal to joe.
– Type hinted return value
– foreach multidimensional array
example- foreach($a1 as $a2 => list($a3,$a4))
I hope PHP developing experience will certainly grow more interesting as soon as this version is out in the world.
Well I am one of those people who are eagerly waiting for the new release of PHP v6.
PHP 6 was put on indefinite hold wasn’t it?
Well I am not really sure… but I believe so 🙂 And even now they haven’t released it as a stable version 🙁
Well, there is many issues to be solved by the PHP development team
Yeah, I think the changes are bigger that php 5.6 will make it in the near feature and not php 6.0. Though I don’t even want to say if php 5.6 will be released soon.
5.6 should be 5.4 ofcourse
I agree to Anthony, changes have endless possibilities and all are expected in v5.x series or may be in v6
Something about OOP?
As i said these are the expected changes. I am sure they will have some improvement plan for OOP concept too, but right now not much known about that. In-fact i read many article on this topic and all my research suggest that the changes discussed here might come with in the version 5 of near future rather than in version 6. for example you may find these changes in 5.4 or higher.
there is lot of confusion in the release of version 6.
We will keep updating on any news related to version 6
As far as I know, they wanted to add some kind of “multi-ineritance” with something called “Traits”. It’s said that given the problems that have arised due to the unicode migration, they might release a 5.4 version.
Info about Traits: http://simas.posterous.com/new-to-php-54-traits
I agree what you said. The main problem with php is its unicode support.
according to some sources
PHP source code itself must be encoded in an ASCII-compatible encoding and there is no way to use Unicode codepoints directly. If you want to store a character in a variable, you either have to use a short string of bytes (the encoded representation of the character) or an integer representing the character’s Unicode codepoint. But converting between a codepoint and its encoded representation requires ugly work-arounds and wrappers, as PHP itself provides no easy mechanism for doing this.
PHP v6 is on hold, not currently been developed.
The developers don’t see why of v6 when v5.X works wonderful. I agree. The changes that you are telling can be “easily” adapted to v5.x
Yes chema, On thing i would like to point out is that developers are in great confusion about the unicode problem, they are fixing other problems and releasing in future v5.x, so not to surprise if you see the changes in v5.x rather than expecting it in v6
$x = $_POST[‘name’] ?: ‘joe’ i.e if $x is true, $x will be equal to joe.
i.e $_POST[‘name’] is true then $_POST[‘name’] else ‘joe’
works in current version for me
Great, as i said they are adding some of these features in 5.x future version rather than in version 6.
well, i never tried this till date so unaware of this functionality
Thanks for this wonderful piece of information
Its working like this in PHP 5.3
I’m not really impressed by the push to move away from {} to reference string index positions. Strings are not arrays, so using similar context creates more readability problems.
What’s the reason behind this change? Just a couple of years ago, curly braces were the preferred approach.
I don’t know the reason behind this change, perhaps they want to point words as array of strings and hence using the standard notation of array to access the strings
Also they want to add extra functionality in [ ] notation like ‘susbstr’ and ‘array_slice’ directly.
Why are you saying “expected” when this is 100% speculation?
As previously mentioned 6.0 is “on hold” and I believe there was even discussion of not going to 6.0 but going to 7 or something, because of the stigma associated with 6.0 (speculation and other things like this) – that’s just my fuzzy memory though.
This should be “changes being discussed” or “possible changes to expect in PHP’s future” and nothing relating to a version, and nothing saying “expected” – unless you are coding it and committing it yourself or know someone who is.
@Mike i agree what you said. The changes are always associated with some version that’s what i thought and did writing but any way next time i will take care.