New Features Of PHP 5.4.x
I’m happy to discuss about the new features of PHP 5.4.X here. New Features are lot in numbers, but I’ll be getting into out of box items alone today.
Improved performance and reduced memory conception is one of the key features added in it. The first one is Traits, it’s a method of code re-usability, implemented from php. In the object oriented scripting the traits allows to access sets of methods freely and independently. While inheriting classes, the traits enable to reuse code in a single inheritance. We can directly call particular hierarchies methods using traits.
The next parameter is closures. It’s nothing but anonymous functions. It allows creating functions without specified name. One can use “$this” key value inside closures functions. Not only for this one, also has it had many other uses.
Short array syntax that is array improvement has been added in it. Short open tag “
The next parameter is built in web server. Php now supports its own small web server for development purpose alone but not for production server purpose. The developer can test their files using this built-in web server. The localhost:8000 port allows the users to execute their files. The execution is also possible from command line making necessary changes to document root in php router file. The php router script file keeps executing on every request.
Upload progress of files now achieved through session extension. In the past, getting upload file progress was through external packages. But now can get the upload file progress through session data. For this, one need to enable the required features in php.ini file. By using the following code this can be done. “”
The php 5.4.x has removed few features and added new alternate features for the purpose of their internal use. magic_quotes(), safe_mode(), register_global() and allow call time pass reference functions were few among the removed functions. Also to make a point, UTF-8 still remains to be the default char set in php.ini file.