New features in PHP5+ | PHP7
PHP 7 is scheduled to be released on Nov 2015. So what are the new things that a PHP developer must learn to beat the heat of php. Starting from PHP 5.3 there are many new things that are added to PHP, some of them are explored below.
1 PHP 5.3
PHP 7 is scheduled to be released on Nov 2015. So what are the new things that a PHP developer must learn to beat the heat of php. Starting from PHP 5.3 there are many new things that are added to PHP, some of them are explored below.
1 PHP 5.3
- Closures - Closures and lambda functions can make programming much easier
- New INI files - Two new INI files which will replace the current INI's packaged with PHP. One focused on production deployments and the other focused on development deployments.
2 PHP 5.4
- Traits - Mechanism for code reuse in single inheritance languages such as PHP. It 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.
- Short array syntax - [ ] === array()
- Builtin server - php -S localhost:8000
3 PHP 5.5
- Generators - Generators provide an easy, boilerplate-free way of implementing iterators.
- Finally keyword - try catch finally
4 PHP 5.6
- Inbuilt debugger - A PHP debugger
- Exponential operator - **
5 PHP 7.0
- Anonymous classes - Classes with no names
- Combined comparison(Spaceship) operator - <=>
- Return types - Adds return types to functions, methods and closures
- Null coalesce operator- ??
- Scalar type hint
Note: For more insight checkout below links: