The next version of PHP, which saw its first release candidate today, has some really awesome new features. You can see a complete list of changes in the README, but here are the ones that caught my eye.
- Support for Traits (i.e., mix-ins; addresses the multiple-inheritance problem).
- Support for chaining from the constructor:
- Support for
- Closures inherit
$thisfrom the outer scope.
ReflectionClass::newInstanceWithoutConstructor()to create a new instance of a class without invoking its constructor.
- Added a new typehint:
- Array dereferencing and short array syntax:
echo [1, 2, 3]
json_encode()now supports these additional flags:
- Multibyte support is enabled by default.
unserialize()and ternary operator performance.
- IPv6 support.
Fixing the cruft
- Removed magic quotes, safe mode, register globals, allow call-time pass-by-reference, and more!
- Default character set is now