Finishing php structural impl and tests