Algebraic interfaces for php