Translating optional zval ** with zend_parse_parameters() to PHP 7
| From: | Thomas Hruska | Date: | Fri, 25 Nov 2016 03:13:21 +0000 |
| Subject: | Translating optional zval ** with zend_parse_parameters() to PHP 7 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-97167@lists.php.net to get a copy of this message | ||
I'm working on updating an extension for PHP 7 compatibility. I have one function that uses an optional zval ** with zend_parse_parameters().
zval **zprevcount = NULL;
int count;
int argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|Z", &zprevcount) == FAILURE) return;
...
if (argc > 0)
{
count = (int)PrevCount;
zval_dtor(*zprevcount);
ZVAL_LONG(*zprevcount, count);
}
What's the correct way to translate that into PHP 7?
--
Thomas Hruska
CubicleSoft President
I've got great, time saving software that you will find useful.
http://cubiclesoft.com/