diff --git a/src/Php/CompilerBase.php b/src/Php/CompilerBase.php index 538c00b3..4f5ec4dd 100644 --- a/src/Php/CompilerBase.php +++ b/src/Php/CompilerBase.php @@ -4014,7 +4014,7 @@ class CompilerBase extends \PhpAot\Core\Translator $class = $this->parseIdentifier($expr->class); $propertyName = $this->parseIdentifier($expr->name); if ($class === 'self') { - $class = $this->class; + $class = $this->getFullClassName(); } elseif ($class === 'parent') { if (!$this->classDef->extends) { $this->fatalError($expr, 'Cannot access parent:: when current class does not extend any class'); diff --git a/tests/aot/coalesce/004.phpt b/tests/aot/coalesce/004.phpt index 2cbe1b1c..67c790bf 100644 --- a/tests/aot/coalesce/004.phpt +++ b/tests/aot/coalesce/004.phpt @@ -3,16 +3,19 @@ Test ?? operator --FILE--