@Crell Depends on the context.
For a library, you have to keep it in place until your minimum supported PHP version matches where the resource class was introduced.
For an application, it depends on your migration strategy. Some will just jump to the new version; others will do stepped migrations, where code needs to run on both PHP versions before they can switch off the old version.