Quercus, meet PHP 5.4 and shake hands, please
I just extended Quercus to support the new core language features of PHP 5.4. The changes are currently in our subversion repository and should be in our next release: 4.0.34. Traits, new in 5.4, was a bit of a pain to implement because of all the weird edge cases (i.e. __CLASS__, insteadof, as). Here’s a list of what’s new:
- traits
<?php trait T0 { function foo() { echo "inside T0->foo()\n"; } } class A { use T0; } $a = new A(); $a->foo(); ?> - short array syntax
<?php $a = ["a" => 123, "b" => 456]; ?>
- function array dereferencing
<?php $a[0](); ?>
- $this use in closures
<?php class A { var $foo = 123; function test() { $fun = function() { var_dump($this->foo); }; $fun(); } } $a = new A(); $a->test(); ?> - <?= short open tag is now always on
<?php $hello = "hello world"; ?> <b><?= $hello ?></b>
- class member access on instantiation
<?php class A { function foo() { echo "inside A->foo()\n"; } } (new A())->foo(); ?> - Class::{expr}() syntax
<?php class A { static function foo() { echo "inside A::foo()\n"; } } $name = "foo"; A::{$name}(); ?> - binary number format: 0b001001101
<?php // int(7) var_dump(0b111); ?>
- $_SERVER['REQUEST_TIME_FLOAT'] is populated
<?php // returns a float (i.e. float(1356829982.6495)) var_dump($_SERVER['REQUEST_TIME_FLOAT']); ?>
And for those that are still with me, I’m aiming to have PHP 5.5 support in our 4.0.35 release :).
– Nam
Nam Nguyen is a Software Engineer at Caucho Technology in San Diego/San Francisco. He is currently the lead for the Quercus project.

April 27th, 2013 at 10:39 am
Hello i was trying to run an app developed on fuelphp and i noticed that php 5.3 class_alias function was not implemented, why is that?
will it be implemented in the future?
Thanks.
May 16th, 2013 at 5:31 am
Hi,
I filed a bug report for it at:
http://bugs.caucho.com/view.php?id=5443
We should be implementing it shortly. Thanks.