bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.56k stars 92 forks source link

v1.11.0 Expected type 'string'. Found 'class-string<Foo>' #2919

Closed ChinaMoli closed 2 days ago

ChinaMoli commented 4 days ago

Describe the bug Passing Foo::class into a function that requires string type in strict mode will result in an error.

To Reproduce

<?php

declare(strict_types=1);

class Foo {};
class Bar extends Foo {};
// Expected type 'string'. Found 'class-string<Foo>'.
var_dump(is_subclass_of(new Bar, Foo::class));

Expected behavior There should be no errors.

Screenshots PixPin_2024-06-29_16-18-49

Platform and version OS: Windows 10 WSL2 Intelephense version: v1.11.0 (pre-release)

bmewburn commented 4 days ago

Thankyou!