Fix registerPHPFunction when passing an array of functions to register. Fixes #2161