-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Milestone
Description
Bug report
Code snippet that reproduces the problem
https://phpstan.org/r/d14466f0-f81e-4594-8ba9-8d87badb70f6
$original = "I just wanna tell you how I'm feeling\nGotta make you understand";
$encrypted = '';
$decrypted = '';
if (! @\openssl_public_encrypt($original, $encrypted, $pupKey, OPENSSL_PKCS1_OAEP_PADDING)) {
throw new Exception('Unable to encrypt data, invalid key provided?');
}The openssl_public_encrypt() function sets $decrypted, but PHPStan reports the condition is always true
as it doesn't take-in the fact the the $decrypted variable is mutated as argument.
Removing $decrypted = ''; fixes the issue.
Expected output
No errors!
Reactions are currently unavailable