Update nesting to properly nest PHP functions