For sure, it’s not related to your version of PHP.
When using any function added by a plugin, you must first check that the function exists. Otherwise you’ll experience such issue. For example, each time the plugin is updated (because WP deactivates the plugin during the update).
Additionnally, Polylang functions are defined only when at least one language has been created.