Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

php extensions

0 views
Skip to first unread message

chris berg

unread,
Mar 23, 2003, 10:35:22 PM3/23/03
to
hello.
i have reviewed the documentation on writing php extenstions at
http://www.php.net/manual/en/zend.php, but i am left with a question.

i have seen the defined RETURN_* and RETVAL_* macros and have used them successfully,
but i am curious about how to return an array (specifically an array of strings) from
a function. RETURN_STRING does not seem to work.

for example, the builtin 'stat' function returns an array of values. i am looking to
implement a similar function.
Thank you.

B. Johannessen

unread,
Mar 24, 2003, 2:55:27 AM3/24/03
to
chris berg <cbe...@XXXXX.wharton.upenn.edu> wrote:
> i have seen the defined RETURN_* and RETVAL_* macros and have used them successfully,
> but i am curious about how to return an array (specifically an array of strings) from
> a function. RETURN_STRING does not seem to work.
>
> for example, the builtin 'stat' function returns an array of values. i am looking to
> implement a similar function.

have a look at php-4.3.1/ext/standard/file.c from the php source.
the function on line 1922 "(PHP_NAMED_FUNCTION(php_if_fstat)" is
a good example.


Bob

--
B. Johannessen sip:b...@h.db.org
b...@db.org tel:+47 33314030
http://db.org/ fax:+47 33313846
E9D4 D43C A6AE 80D8 98C8 878F A288 AC53 230E 1658 mob:+47 97152009

el...@no.spam

unread,
Mar 24, 2003, 8:16:16 PM3/24/03
to
In article <b5ludq$298q$1...@netnews.upenn.edu>,
chris berg <cbe...@XXXXX.wharton.upenn.edu> wrote:

See the note about complex types at the bottom of this page:

http://www.php.net/manual/en/zend.returning.php

--
http://www.spinics.net/linux/

0 new messages