Class template for PHP