I followed the steps mentioned at Passing a variable by reference into a PHP extension for Passing a variable by reference into a PHP extension. This is working fine for PHP 5 but when I try the same in Php7 and its not working. Any suggestions? Here is my code snippet.
ZEND_BEGIN_ARG_INFO(params_ref_arg_arginfo, 0)
ZEND_ARG_INFO(1, a)
ZEND_END_ARG_INFO()
PHP_FUNCTION(sample_byref_compiletime)
{
zval *a;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a ) == FAILURE)
{
php_printf("Error");
RETURN_NULL();
}
zval_dtor(a);
ZVAL_LONG(a, 40);
}
PHP_FE(sample_byref_compiletime, params_ref_arg_arginfo)
Thank you for the help.