Skip to content

Commit

Permalink
Disallow is_resource()
Browse files Browse the repository at this point in the history
PHP 8.0+ is migrating away from the `resource` type in favor of normal
classes, see <php/php-tasks#6>.

Code should generally check for return values being false rather than using
is_resource().

Bug: T260735
Change-Id: Iad84a60b302b22497f7ec1282e4e6223a32ebaeb
  • Loading branch information
legoktm authored and umherirrender committed Sep 17, 2020
1 parent 1ccf73d commit a8a1f50
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MediaWiki/Sniffs/Usage/ForbiddenFunctionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class ForbiddenFunctionsSniff implements Sniff {
'shell_exec' => false,
'system' => false,
'isset' => false,
// resource type is going away in PHP 8.0+ (T260735)
'is_resource' => false,
];

/**
Expand Down

0 comments on commit a8a1f50

Please sign in to comment.