You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common type of bug would be using features from newer PHP versions when the project needs to support older versions.
Obviously there's other ways to detect this, such as providing a plugin to run php --no-php-ini --syntax-check < file_or_tmpfile.php, or doing that with a separate tool
A reasonable default would be the php version used to run psalm (or guess from composer.json). For backwards compatibility, I'd assume 7.3 would be the most similar
Examples:
Nullable types/void in PHP 7.1, object in php 7.2, etc
Psalm does not warn about extra trailing commas in function calls (e.g. if running with PHP 7.1). Those became valid in PHP 7.3. (I'd assume PHP-Parser provides this)
<?php
call_user_func(/** @return void */function () {
$other = 'x';
var_export(is_string(
$other, // Psalm doesn't warn about trailing commas
));
var_export(is_string($missing)); // Psalm correctly warns about this
});
The text was updated successfully, but these errors were encountered:
A common type of bug would be using features from newer PHP versions when the project needs to support older versions.
Obviously there's other ways to detect this, such as providing a plugin to run
php --no-php-ini --syntax-check < file_or_tmpfile.php
, or doing that with a separate toolA reasonable default would be the php version used to run psalm (or guess from composer.json). For backwards compatibility, I'd assume 7.3 would be the most similar
Examples:
The text was updated successfully, but these errors were encountered: