diff --git a/src/Php/CompilerBase.php b/src/Php/CompilerBase.php index aef6483b..963ea948 100644 --- a/src/Php/CompilerBase.php +++ b/src/Php/CompilerBase.php @@ -5323,10 +5323,6 @@ class CompilerBase extends \PhpAot\Core\Translator { if (!$this->hasVar($name)) { $this->addLocalVar($name, $defaultType); - } elseif ($defaultType === self::TYPE_VAR) { - if ($this->getVarType($name) !== self::TYPE_VAR) { - $this->fatalError($node, 'Cannot assign value to variable $' . $name . ' of type ' . $this->getVarType($name)); - } } else { if ($this->getVarType($name) !== $defaultType) { $this->fatalError($node, 'Cannot assign value to variable $' . $name . ' of type ' . $this->getVarType($name) . ' with type ' . $defaultType); diff --git a/tests/aot/type_hits/005.phpt b/tests/aot/type_hits/005.phpt index a1f8faff..0b586e1d 100644 --- a/tests/aot/type_hits/005.phpt +++ b/tests/aot/type_hits/005.phpt @@ -30,7 +30,7 @@ class Baz { } class FooB { - function configure(FooA $o) { + function configure(EsmtpTransport $o) { $o->send('Hello World', 'foo@bar'); } }