Along with the above mentioned additions, a variety of new functions and additional methods to existing classes have been added.
Classes now support the Class::{expr}() syntax. Now you can accomplish something like the following for static calls:
class Test
{
public static function parseH4()
{
echo "H4 Parsed";
}
public static function parseH2()
{
echo "H2 Parsed";
}
}
$t = new Test;
$method_prefix = "parse";
$t::{$method_prefix . "h4"}();
$t::{$method_prefix . "h2"}();
Although not a very creative use of the idea, the real power of the above will manifest itself when using dynamic method calls. Along with the support for expressions while calling static class methods, class member access on instantiation has also been added, as shown below.
