The beta version of php5.4 is coming soon. Many new features of php5.4 are available on the Internet. Here is an official list for reference. php. netviewvcphpphp-src .... For me, apart from fixing some bugs, it is most worth looking forward... the beta version of php 5.4 is coming soon. Many new features of php 5.4 are available on the Internet. Here is an official list for reference: http://svn.php.net/viewvc/php/php-src .... For me, apart from fixing some bugs, two aspects are most worth looking forward.
Huge Performance Improvement
According to some known performance tests, the execution speed can be roughly doubled, while the memory usage is reduced to 1/3 to 1/2 in the previous version. If the final release can ensure this score, it must be said that this is a huge improvement.
- Http://www.slideshare.net/paulgao/com...
- Http://www.paulgao.com.cn/index.php? I...
Introduction of new features
It is very interesting that php 5.4 has introduced the Traits concept in scalar. Anyone familiar with scalar knows this.Traits
IsClass
AndInterface
It is an abstract definition, but different from the interface, it can include actual methods and member variables.abstract class
The difference is that it can be multiple! This will enrich php's oop features, but I am also pessimistic that this will make the concept of oop more confusing for many php grassroots :(
trait A{ public function foo();}trait B{ public function bar() { return; }}class C{ use A, B; public function execute() { echo $this->bar(); }}
Another feature that I am concerned about is that php 5.4 Finally supports full-type function type detection. We can only use it in type detection before php 5.3.array
AndClass
For example
function foo(array input, MyClass key) { return;}
However, php 5.4 supports all built-in php types (String
,Int
,Float
,Resource
,Bool
So that we don't have to write a similaris_string
And so on.
There is another issue that has plagued countless php developers and finally fixed it in php 5.4 (at least I think it is a fix ). That is, the array key value is directly used in the return value of the function.
Function func () {return array (1, 2, 3);} echo func () [1]; // output 2
This seemingly natural thing will not be fixed until php 5.4. If it is fixed earlier, how many variables can be saved and how much carbon dioxide can be reduced.
There is also good news for beginners of php, that is, php 5.4 will contain a simple server, so you don't have to worry about how to configure apache and so on.
What I expect
Php is far from a perfect language in my eyes, but fortunately he is a very good language. So I have my expectation for it, that is
Added support for server persistence. Although there are apc cache and other things, there is no language-level solution, and it is still inconvenient.
Some foreigners have expectations for php at http://www.reddit.com/r/php/comments/...what new features do you expect?
Reply content:
The beta version of php 5.4 is coming soon. Many new features of php 5.4 are available on the Internet. Here is an official list for reference: http://svn.php.net/viewvc/php/php-src .... For me, apart from fixing some bugs, two aspects are most worth looking forward.
Huge Performance Improvement
According to some known performance tests, the execution speed can be roughly doubled, while the memory usage is reduced to 1/3 to 1/2 in the previous version. If the final release can ensure this score, it must be said that this is a huge improvement.
- Http://www.slideshare.net/paulgao/com...
- Http://www.paulgao.com.cn/index.php? I...
Introduction of new features
It is very interesting that php 5.4 has introduced the Traits concept in scalar. Anyone familiar with scalar knows this.Traits
IsClass
AndInterface
It is an abstract definition, but different from the interface, it can include actual methods and member variables.abstract class
The difference is that it can be multiple! This will enrich php's oop features, but I am also pessimistic that this will make the concept of oop more confusing for many php grassroots :(
trait A{ public function foo();}trait B{ public function bar() { return; }}class C{ use A, B; public function execute() { echo $this->bar(); }}
Another feature that I am concerned about is that php 5.4 Finally supports full-type function type detection. We can only use it in type detection before php 5.3.array
AndClass
For example
function foo(array input, MyClass key) { return;}
However, php 5.4 supports all built-in php types (String
,Int
,Float
,Resource
,Bool
So that we don't have to write a similaris_string
And so on.
There is another issue that has plagued countless php developers and finally fixed it in php 5.4 (at least I think it is a fix ). That is, the array key value is directly used in the return value of the function.
Function func () {return array (1, 2, 3);} echo func () [1]; // output 2
This seemingly natural thing will not be fixed until php 5.4. If it is fixed earlier, how many variables can be saved and how much carbon dioxide can be reduced.
There is also good news for beginners of php, that is, php 5.4 will contain a simple server, so you don't have to worry about how to configure apache and so on.
What I expect
Php is far from a perfect language in my eyes, but fortunately he is a very good language. So I have my expectation for it, that is
Added support for server persistence. Although there are apc cache and other things, there is no language-level solution, and it is still inconvenient.
Some foreigners have expectations for php at http://www.reddit.com/r/php/comments/...what new features do you expect?
I'm looking forward to all the features! However, we can also see that php is aware of the rising pressure from ruby and so on. In fact, the new features here are nothing new for relatively new scripting languages.
In addition, I think the built-in server should be consistent with ruby (there is a server written in ruby gem, which is used in rails) it is easy to use in the development environment.
In addition, the persistence mentioned by @ joyqi is what I expect. The current features of php lead to repeated jobs that run frequently. For example, most of the Framework initialization tasks occupy excessive computing resources.
The following are my feelings about each new feature:
- Trait: php can finally implement aop perfectly.
- Full function Detection: api designers burst into tears
- Function return values directly use the array key value: phper no longer envy javascript and other programmers
Http://www.slideshare.net/paulgao/com...
The content of this PPT will be updated as 5.4 progresses. I hope you will continue to pay attention to it.
Sorry, my description of scalar type hint in this ppt is incorrect. The PHP Team removed this feature at the last moment of generating the 5.4 branch, the general reason may be that the implementation is not perfect. I didn't notice at the time that this feature still exists in the code. Sorry here. The ppt has been updated.
We are most looking forward to performance improvement for O & M!
It is interesting to include a server. Is this server written in php?
PHP 5.4 alpha1 has just been released.
New features:
Added: Traits language construct
Added: Array dereferencing support
Added: DTrace support
Improved: Improved Zend Engine memory usage and performance
Moved: ext/sqlite moved to pecl (sqlite3 support is still built-in)
Delete features:
Removed: break/continue $ var syntax
Removed: register_globals, allow_call_time_pass_reference, and register_long_arrays ini options
Removed: session_is_regisitered (), session_registered (), and session_unregister ()
This is the first release that adopts the releaseprocess RFC. The next alpha will be> released within four weeks. The PHP 5.4 feature set and API has not been finalized.
More details
Http://www.php.net/archive/2011.php# I...
I hope to support more svn operation functions. Many svn functions in previous versions are blank, and I want to use them. I feel a bit like a mouse.
Php5.4 has been officially released. Google ranked first in this Q &.