A class of logical gates with PHP