Implement constant expressions in hhvm
commite3570ad140d196d1b66752eab35d90d19911da80
authorLiran Nuna <liranuna@fb.com>
Tue, 13 May 2014 17:21:16 +0000 (13 10:21 -0700)
committerJoelMarcey <joelm@fb.com>
Tue, 13 May 2014 22:54:44 +0000 (13 15:54 -0700)
treedbaecc530c90b0c43307c737750e62c4af9388c6
parentf3b4b90a5f497f50a702d340be6297fbd9b85601
Implement constant expressions in hhvm

Summary: PHP 5.6 allows constant expressions in the right side of `const` expressions instead of just scalars. This diff implements this feature in HHVM.

PHP RFC: https://wiki.php.net/rfc/const_scalar_exprs

Reviewed By: @jdelong

Differential Revision: D1290097
16 files changed:
hphp/doc/bytecode.specification
hphp/hhbbc/interp.cpp
hphp/parser/hphp.tab.cpp
hphp/parser/hphp.y
hphp/runtime/ext/reflection/ext_reflection-classes.php
hphp/runtime/vm/class.cpp
hphp/runtime/vm/jit/translator-runtime.cpp
hphp/test/slow/constant/const_expr.php [new file with mode: 0644]
hphp/test/slow/constant/const_expr.php.expect [new file with mode: 0644]
hphp/test/slow/constant/magic_constants.php [new file with mode: 0644]
hphp/test/slow/constant/magic_constants.php.expectf [new file with mode: 0644]
hphp/test/slow/reflection/get_default_constant_name.php [new file with mode: 0644]
hphp/test/slow/reflection/get_default_constant_name.php.expect [new file with mode: 0644]
hphp/test/slow/reflection/get_default_constant_name.php.norepo [new file with mode: 0644]
hphp/test/zend/good/Zend/tests/static_variable.php [new file with mode: 0644]
hphp/test/zend/good/Zend/tests/static_variable.php.expect [new file with mode: 0644]