shifting fundc to php for functionality