[PHP-DEV] how declare protected array property at internal class properly

2007-10-04 Thread Denis Gabaidulin
How can i do subj ?

I try make this with follwoing code:

declare prop:

zend_declare_property_null(ns_ce_ ## my_class, prop, strlen(prop),
, ZEND_ACC_PROTECTED TSRMLS_CC);


at constructor:

zval *prop;

/* init */
prop =  zend_read_property(Z_OBJCE_P(getThis()), getThis(), prop,
strlen(prop,), 1 TSRMLS_CC);

array_init(prop);


After building ext (with debug) i get following error:

Fatal error: Internal zval's can't be arrays, objects or resources

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] how declare protected array property at internal class properly

2007-10-04 Thread Michael Wallner
Denis Gabaidulin wrote:
 How can i do subj ?

 at constructor:
 
 zval *prop;
 
 /* init */
 prop =  zend_read_property(Z_OBJCE_P(getThis()), getThis(), prop,
 strlen(prop,), 1 TSRMLS_CC);
 
 array_init(prop);

zval *prop;
MAKE_STD_ZVAL(prop);
array_init(prop);
zend_update_property(Z_OBJCE_P(getThis()), getThis(),
ZEND_STRS(prop)-1, prop TSRMLS_CC);
zval_ptr_dtor(prop);

IIRC complex types for internal zvals was on some engine todo or--at
least--wish list...

Regards,
-- 
Michael

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] how declare protected array property at internal class properly

2007-10-04 Thread Denis Gabaidulin
On 10/5/07, Michael Wallner [EMAIL PROTECTED] wrote:

 zval *prop;
 MAKE_STD_ZVAL(prop);
 array_init(prop);
 zend_update_property(Z_OBJCE_P(getThis()), getThis(),
 ZEND_STRS(prop)-1, prop TSRMLS_CC);
 zval_ptr_dtor(prop);

 IIRC complex types for internal zvals was on some engine todo or--at
 least--wish list...

Good news...


 Regards,
 --
 Michael


Thanks a lot, Michael.

 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php