parameterized version for php