vimeo/psalm

Incorrect assumptions about mysqli object parameters

Open

#4 502 ouverte le 7 nov. 2020

Voir sur GitHub
 (6 commentaires) (0 réactions) (0 assignés)PHP (668 forks)batch import
Help wantedenhancementinternal stubs/callmap

Métriques du dépôt

Stars
 (5 369 stars)
Métriques de merge PR
 (Merge moyen 3j 12h) (5 PRs mergées en 30 j)

Description

Example: https://psalm.dev/r/c8e212f816

Psalm assumes the PHP documentation is correct. It is not. Specifically the Mysqli object has a lot of shady stuff going on with strange states of the connection.

In PHP 7.4 sqlstate is false in an empty Mysqli object while client_info is a string. client_info will also be false when a connection is attempted and fails. To make matters worse, the behavior of the class in edge cases like this changes between PHP versions. (I know it's different in PHP 8 and in older PHP 5 versions)

Guide contributeur