Check that the function exists rather than relying on Moodle version