Try something like this:I guess it almost works :
if (rep_CONSP(in)) { array_init(return_value); /* sets it up as an array */
for (i = in; i != Qnil; i = rep_CDR(i)) { zval *tmp;
MAKE_STD_ZVAL(tmp); rep_data_converter(rep_CAR(i), tmp); add_next_index_zval(return_value, tmp); /* equivalent to $ret[] = $tmp */ } }
if(rep_CONSP(in)) {
zval php_array;
//zend_hash_init(&php_array,100,
repv i,t;
for(i=in;i!=Qnil;i=rep_CDR(i)) {
printf("REP FWD to next element\n");
rep_data_converter(rep_CAR(i),&t);
/* ??? add t to array php_array */
}
}
if(rep_CONSP(in)) {
repv i;
for(i=in;i!=Qnil;i=rep_CDR(i)) {
zval *t;
MAKE_STD_ZVAL(t);
printf("REP FWD to next element PT1\n");
rep_data_converter(rep_CAR(i),t);
printf("REP FWD to next element PT2\n");
add_next_index_zval(return_value, t);
printf("REP FWD to next element PT3\n");
/* ??? add t to array() */
}
}---8<---
REP FWD to next element PT1 REP FWD to next element PT2 rep: received fatal signal: Segmentation fault
struct debug_buf common:
Backtrace in `fatal_signal_handler':
<(null)+1107463240>
<add_next_index_zval+28>
<rep_data_converter+215>
<zif_rep_eval+201>
<execute+7234>
<zend_execute_scripts+107>
<php_execute_script+316>
<main+1629>Lisp backtrace:
Segmentation fault ---8<---
Is that rep's or php's problem? May be t should be duplicated? If yes, how?
-- NetCat
------------------------------------------------------ SPAM-Free 10mb Free email + Antivirus + POP3 + more... Get it at http://www.doal.co.il:81/free/?c=all-spam
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
