Don't repeat yourself functions for PHP