using hash_find for objects ?
| From: | Mark Musone | Date: | Thu, 26 Aug 1999 14:26:10 +0000 |
| Subject: | using hash_find for objects ? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-10231@lists.php.net to get a copy of this message | ||
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