fix php method declaration compatibility issues