Re: [PHP] Extensions: parameters as references
Yasir Malik wrote: Is there any list (or forum) that can help me with this? Thanks, Yasir You probably will have more luck trying out the PECL group. These authors write PHP extensions and have the knowledge / desire to work on extensions. Not too many of us "regular" developers have actually had the need to write our own extensions, you know what I mean? Jason -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extensions: parameters as references
Is there any list (or forum) that can help me with this? Thanks, Yasir On Fri, 17 Jun 2005, Yasir Malik wrote: Date: Fri, 17 Jun 2005 11:51:24 -0400 (EDT) From: Yasir Malik <[EMAIL PROTECTED]> To: php-general@lists.php.net Subject: [PHP] Extensions: parameters as references I am creating a PHP extension. In my function, I want the parameter to be a reference. The extension function works fine only if the variable passed is initialized. For example, here is the extension function: ZEND_FUNCTION(first_module) { zval *parameter; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶meter) == FAILURE) return; ZVAL_LONG(parameter, 78); } When I call this as it works fine, but when I call it as: nothing is outputted. I looked at the source code for various extensions, and I noticed that they called the deconstructor zval_dtor(). I tried this, but it still did not work: ZEND_FUNCTION(first_module) { zval *parameter; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶meter) == FAILURE) return; zval_dtor(parameter); ZVAL_LONG(parameter, 78); } Thanks, Yasir -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Extensions: parameters as references
I am creating a PHP extension. In my function, I want the parameter to be a reference. The extension function works fine only if the variable passed is initialized. For example, here is the extension function: ZEND_FUNCTION(first_module) { zval *parameter; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶meter) == FAILURE) return; ZVAL_LONG(parameter, 78); } When I call this as it works fine, but when I call it as: nothing is outputted. I looked at the source code for various extensions, and I noticed that they called the deconstructor zval_dtor(). I tried this, but it still did not work: ZEND_FUNCTION(first_module) { zval *parameter; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶meter) == FAILURE) return; zval_dtor(parameter); ZVAL_LONG(parameter, 78); } Thanks, Yasir -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php