PHP object implementation in extension