Php Convert Nested Stdclass To Array Python