yii2: Fatal error: Error when compiled in HHVM
What steps will reproduce the problem?
Compile my yii2 project by command:
INDEX_TMP="/var/run/hhvm/fileindex"
find /var/www/html -name \*.php > $INDEX_TMP
hhvm --hphp -t hhbc -v AllVolatile=true --input-list $INDEX_TMP --output-dir /var/run/hhvm/
Yii2 throw an exception in class Session.php
private function setCookieParamsInternal()
{
$data = $this->getCookieParams();
extract($data); // failed
if (isset($lifetime, $path, $domain, $secure, $httponly)) {
session_set_cookie_params($lifetime, $path, $domain, $secure, $httponly);
} else {
throw new InvalidParamException('Please make sure cookieParams contains these elements: lifetime, path, domain, secure and httponly.');
}
}
What is the expected result?
Run yii2 application after compiled code by hhvm
What do you get instead?
extract() functions can’t run in hhvm compiled. Link to issue: Fatal error: Could not create variable environment (repo mode only)
Additional info
| Q | A |
|---|---|
| Yii version | 2.0.9 |
| PHP version | 7.0.8 |
| Operating system | Centos 7 |
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 21 (20 by maintainers)
22a224d232f23502bc2bfa3afce38dd337513b5a
Although, I can:
However, I am unsure if it work on HHVM either.
@thanhpv-h9 is talking about compiling code for HHVM. So far we’ve checked VM-runtime version.
I’ve verified that HHVM compiles project after my patch, but did not verified that it failed before.
Verified on Ubunty 14.04 with
Commit is reverted eb02b36
@thanhpv-h9 can you check if @klimov-paul solution works?
It’s not the only place we’re using
extract():Seems it’s not going to be fixed in HHVM. Am I right?