Skip to content

Fix for 7.1 after #917#919

Merged
mnapoli merged 1 commit intoPHP-DI:masterfrom
vhd:master
Aug 16, 2025
Merged

Fix for 7.1 after #917#919
mnapoli merged 1 commit intoPHP-DI:masterfrom
vhd:master

Conversation

@vhd
Copy link
Copy Markdown
Contributor

@vhd vhd commented Aug 15, 2025

Should fix #918 after #917

@vhd
Copy link
Copy Markdown
Contributor Author

vhd commented Aug 15, 2025

PoC script just in case

<?php

declare(strict_types=1);

interface SomeInterface
{
    public function someMethod(): object;
}

class SomeBrokenClass implements SomeInterface
{
    public function someMethod(): NonExistentClass { }
}

class SomeWorkingClass implements SomeInterface
{
    public function someMethod(): DateTimeImmutable { }
}

Should produce

PHP Fatal error:  Could not check compatibility between SomeBrokenClass::someMethod(): NonExistentClass and SomeInterface::someMethod(): object, because class NonExistentClass is not available

It passed tests just because of those lines

$proxyFactory = (\PHP_VERSION_ID >= 80400) ? new NativeProxyFactory : new ProxyFactory;

@mnapoli
Copy link
Copy Markdown
Member

mnapoli commented Aug 16, 2025

Thank you!

@mnapoli mnapoli merged commit f88054c into PHP-DI:master Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fatal error after updating to 7.1 from 7.0.11

2 participants