psalm
psalm copied to clipboard
PHP 8.1 deprecated calls not reported
https://psalm.dev/r/24131c8655
key, current, next, prev, reset on objects is deprecated as of 8.1
Similar issues:
- mb_check_encoding without arguments
- get_class, get_parent_class and get_called_class without arguments
- IntlCalendar::roll() with bool passed as $value
- ctype_ functions called with non-string argument
I found these snippets:
https://psalm.dev/r/24131c8655
<?php
$foo = (object) null;
$bar = current( $foo );
Psalm output (using commit 2e01e9b):
INFO: MixedAssignment - 5:1 - Unable to determine the type that $bar is being assigned to
INFO: UnusedVariable - 5:1 - $bar is never referenced or the value is not used