[PHP-DEV] using hash_find for objects ? From: Mark Musone (musone <email protected>)
Date: 08/26/99

hey all, i'm really hoping someone can tell me where i'm
being braindead..

I have this function that takes in an object, and this object
contains other objects. specifically, the tree looks like this:

        $start->year=1999;
        $start->month=8;
        $start->mday=28;
        $start->hour=0;
        $start->min=0;

        $end->year=1999;
        $end->month=08;
        $end->mday=29;
        $end->hour=0;
        $end->min=0;

        $event->start=$start;
        $event->end=$end;

        $event->category = "category";
        $event->title = "title";
        $event->description = "description";

icap_store_event($stream,$event);

So, now i'm trying to pull in the $start and $end parts of the object...
heres the code snippet that tries to pull out the $start object, and traverse down it:
(note, storeobject was one of the initial function parameters, and i previously
called convert_to_object() on it.

        if(_php3_hash_find(storeobject->value.ht,"start",sizeof("start"),(void **) &temppvalue)== SUCCESS){
          SEPARATE_ZVAL(temppvalue);
          convert_to_object(*temppvalue);
          
          if(_php3_hash_find((*temppvalue)->value.ht,"year",sizeof("year"),(void **) &pvalue)== SUCCESS){
            SEPARATE_ZVAL(pvalue);
            convert_to_long(*pvalue);
            myevent->start.year=(*pvalue)->value.lval;
php_printf("year is %d<br>",(*pvalue)->value.lval);
          }

This aint working though:

780 if(_php3_hash_find((*temppvalue)->value.ht,"year",sizeof("year"),(void **) &pvalue)== SUCCESS){
(gdb) next

Program received signal SIGILL, Illegal instruction.
0x81179e9 in ?? ()

Can anybody please give me a clue?!

Thanks!

Mark

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>