add compatibility to stdClass in php.