refactoring toString on PhpClass