PHP 5.4 - A Major Update
PHP 5.4 - A Major Update
Written by Ian Elliot   
Friday, 02 March 2012

PHP 5.4 has been released and so has a new version of Zend Framework. 

PHP 5.4 brings improvements in memory management and performance, which in turn will make it faster,  a built-in webserver for testing purposes, and features that had been destined for PHP 6.0.

Traits, a mechanism for code re-use is a feature that had been under development for PHP 6.0, the version of PHP that would have seen a complete rewrite of the language using Unicode, rather than ASCII.

Once PHP 6.0 was shelved for being too ambitious some of its innovations were incorporated in PHP 5.4.

According to the PHP reference:

A Trait is intended to reduce some limitations of single inheritance by enabling a developer to reuse sets of methods freely in several independent classes living in different class hierarchies. The semantics of the combination of Traits and classes is defined in a way which reduces complexity, and avoids the typical problems associated with multiple inheritance and Mixins.

A Trait is similar to a class, but only intended to group functionality in a fine-grained and consistent way. It is not possible to instantiate a Trait on its own. It is an addition to traditional inheritance and enables horizontal composition of behavior; that is, the application of class members without requiring inheritance.

Another key feature is shortened array syntax which replaces array ( ) with [ ] as shown here

:

 

Another important change is that Magic Quotes, a features that was supposed to improve security by preventing SQL Injection but in fact was notoriously insecure and had already been deprecated is finally removed. Other deprecated features have also been removed to provide a cleaner code base.

Some users are claiming speed increases as large as 25% and memory usage down 35%. Of course in a production environement these speed increases might be more difficult to achieve but there are also reports that well known PHP applications such as Durpal, Wordpress and others are showing between 10% and 20% speedups.

A migration guide is provided for users upgrading from PHP 5.3.

phplogo

Zend Framework v2 is also a major update claiming more productive collaboration, better application performance, support for cloud services and providers, and a streamlined and simple workflow for developing next-generation mobile applications and APIs.

More Information

PHP 5.4.0 Release Announcement

Download PHP 5.4

 

Related Articles

 

 
 

 

blog comments powered by Disqus

 

To be informed about new articles on I Programmer, subscribe to the RSS feed, follow us on Google+, Twitter, Linkedin or Facebook or sign up for our weekly newsletter.

 

Banner


Forget The Turing Test It's The MacGyver Test That Matters
30/04/2017

There are lots of generalized Turing tests which all work on the general principle that if you can't tell the artificial from the natural then they are for all intents and purposes the same. Now we ha [ ... ]



The Performance Of AngularJS
11/05/2017

AngularJS is a popular and hence important JavaScript framework, but there isn't a lot of information about how it performs in the real world. Some research based on a survey gives us some clues.  [ ... ]


More News

Last Updated ( Friday, 02 March 2012 )
 
 

   
Banner
RSS feed of news items only
I Programmer News
Copyright © 2017 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.