mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
ed2cde1b93
This will highlight unused code. Ref: https://github.com/php/php-src/pull/5412 Ref: https://wiki.php.net/rfc/make-reflection-setaccessible-no-op Ref: https://github.com/php/php-src/pull/5411 Example https://3v4l.org/PNeeZ ```php <?php class Foo { private $bar = 'baz'; private function taz() { return 'waz'; } } //var_dump((new ReflectionProperty(Foo::class, 'bar'))->getValue(new Foo)); //var_dump((new ReflectionMethod(Foo::class, 'taz'))->invoke(new Foo)); ``` Produces (starting from PHP 8.1): ``` string(3) "baz" string(3) "waz" ```