Psalm
Get started
Documentation
Paid support
Plugins
Blog
GitHub
<?php interface Foo { /** * @return static */ public static function create(); } /** @psalm-consistent-constructor */ class Baz implements Foo { public static function create(): static{ return new static(); } } function takesBaz(Baz $a):void{ print_r($a); } $a = Baz::create(); takesBaz($a);
Snippet created on April 27 2022 at 05:23 UTC
Settings
Get link