I've a php script that runs ok on my local (MAC High Sierra 10.13.6, php version 7.1.16) using php file.php ...
hhvm --version
gives HipHop VM 3.11.0 (rel)
When I run from vagrant (hhvm), it complains Fatal error: Arrays are not allowed in class constants in certainfile.php on line xxx
. using hhvm file.php ...
.
In my file, I've a const defined as:
class Lalala {
const AB_C = array(A::a, B::b,...);
function xyz {...use self::AB_C ...}
}
I tried to change it to
define("AB_C", array(A::a, B::b,...));
, but it couldn't even compile with syntax error.
How should I declare the constant arrays here please? Thank you.
define("AB_C", serialize(array(A::a, B::b,...)));
also failed with same syntax error
define("AB_C", jsonencode(array(A::a, B::b,...)));
also failed with same syntax error