You can use this plugin PHP Compatibility Checker for just this purpose. It checks all the code on your site and reports any possible issues.
Install the plugin and activate it on your site in the usual way. When it’s active, there will be a new menu item under Tools called PHP Compatibility. Here, just choose the PHP version you want to upgrade. Then select whether to scan only your active plugins and themes or all extensions on your site.
Start the scan. When done, the plugin will present you with a list of errors and warnings for your site. It will even tell you the file name and line number where it encountered them.