Newbie help
| From: | Robert Silva | Date: | Mon, 27 Sep 2004 01:28:16 +0000 |
| Subject: | Newbie help | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-13002@lists.php.net to get a copy of this message | ||
Trying to register a constant value for a class and it keeps crashing.
Learning C as I go, so I would appreciate some insight. I can figure out
that my *property value is lost during zend_hash_add() but my knowledge
stops there as to why. Tried passing property as property and &property.
ZEND_METHOD(zboolean, __construct)
{
zval *object = getThis();
zval *property
ALLOC_ZVAL(property);
INIT_PZVAL(property);
ZVAL_STRING(property, "true", 1);
zend_hash_add(&(Z_OBJCE_P(object))->constants_table, "TrueString",
sizeof("TrueString")+1, property, sizeof(zval *));
}
Thanks
Bob