Removed duplication of PHP functions