diff --git a/phpunit/src/Backend/BackendOptionsTest.php b/phpunit/src/Backend/BackendOptionsTest.php index f16e722c..e30fff17 100644 --- a/phpunit/src/Backend/BackendOptionsTest.php +++ b/phpunit/src/Backend/BackendOptionsTest.php @@ -441,7 +441,7 @@ class BackendOptionsTest extends TestCase // O1 $opt1 = $compiler->buildCompileOptions(['optimize' => 1]); - $this->assertStringContainsString('/O2', $opt1); + $this->assertStringContainsString('/O1', $opt1); // O2 $opt2 = $compiler->buildCompileOptions(['optimize' => 2]); diff --git a/phpunit/src/PreprocessorTest.php b/phpunit/src/PreprocessorTest.php index e5cb1048..ff3ddb0d 100644 --- a/phpunit/src/PreprocessorTest.php +++ b/phpunit/src/PreprocessorTest.php @@ -187,21 +187,6 @@ class PreprocessorTest extends TestCase $this->assertEquals('App\\Entity\\Base', $result); } - // ======================================================================== - // hasCppFileCache - // ======================================================================== - - public function testHasCppFileCacheWhenDisabled(): void - { - // enableCache defaults to false, so cache should always return false - $this->assertFalse($this->compiler->hasCppFileCache('/tmp/test.php')); - } - - public function testHasCppFileCacheNonexistentFile(): void - { - $this->assertFalse($this->compiler->hasCppFileCache('/nonexistent/path/test.php')); - } - // ======================================================================== // sortFiles // ======================================================================== diff --git a/src/Php/CompilerBase.php b/src/Php/CompilerBase.php index 2614913b..fcc31613 100644 --- a/src/Php/CompilerBase.php +++ b/src/Php/CompilerBase.php @@ -5412,8 +5412,9 @@ class CompilerBase extends \PhpAot\Core\Translator if ($type === self::TYPE_STREAM) { return $this->genStreamNullGuard($expr, $object, $methodName, $fn); } - return $this->parseUniversalMethodCall($expr, $object, $method, $fn); + return $this->parseUniversalMethodCall($expr, $object, $methodName, $fn); } + $this->fatalError($expr, "Cannot call method `{$methodName}()` on variable of type {$type}"); } $this->context->beforeStmtLines[] = '// Method Call: ' . $object . '->' . $this->parseIdentifier($expr->name) . '()'; try {