test on getPHP. refine gen_test to support closure test