returning a bunch of arrays as fields of an object?

From: Date: Mon, 25 Nov 2002 17:38:11 +0000
Subject: returning a bunch of arrays as fields of an object?
Groups: php.dev 
Request: Send a blank email to php-dev+get-91530@lists.php.net to get a copy of this message
OK, so I'm wrapping a C++ library as a PHP extension, and I want one of my functions to return an object that has arrays as fields of it. I have created the arrays: zval *success; MAKE_STD_ZVAL(success); array_init(success); zval *score; MAKE_STD_ZVAL(score); array_init(score); zval *time; MAKE_STD_ZVAL(time); array_init(time); and can populate them, but I'm not sure how I could return an object with 3 fields that are arrays, and one that is a string value. Can someone point me towards further documentation? I was confused by the (lack of a) similar example in the PHP book and the online documentation. If there is a cleaner/more clever way to take an array of struct{}'s and return them as (a) PHP object/objects, and you (the recipients of this email) would share that with me, I would be most grateful. Thanks, and sorry for what is probably a silly question. Thanks in advance, --tim

« previous php.dev (#91530) next »