Check that the function exists rather than relying on the Moodle version