Unable to call php user define function from Zend Extension

177
February 01, 2019, at 01:00 AM

I am trying to create a PHP extension for PHP 7.2, I have already managed to create for 5.6 in PHP 7.2 I have made the required changes in the code based on the new Zend API, but now I am stuck in this point, I want to call a php user define function from the extension.

I have tried with the call_user_function_ex function to call my user define function.

zval *function_name, *retval_ptr, *param_file, **params[1]; 
TSRMLS_FETCH();
ZVAL_STRINGL(function_name, functionRequire,
        strlen(functionRequire));
ZVAL_STRINGL(param_file, ranKey,
        strlen(ranKey));    
params[0] = &param_file;        
php_printf("%s %s 1st",functionRequire,ranKey);
//RETURN_NULL();
if (call_user_function_ex(CG(function_table), NULL, function_name,
        &retval_ptr, 1, params, 0, NULL TSRMLS_CC) != SUCCESS) {
    php_printf("%s\n",contactInfo );        
    zend_error(E_ERROR, "Function call failed ");
    RETURN_NULL();
}
php_printf("%s %s 2nd",functionRequire,ranKey);
RETURN_NULL();
FREE_ZVAL(function_nameCh);
FREE_ZVAL(function_name);
FREE_ZVAL(param_file);

I have tried with printing the value after each statement after that I realize that it getting crashed when it tried to call "call_user_function_ex" function. Am I doing anything wrong but the same code is working fine in PHP 5.6

Please Help.

Rent Charter Buses Company
READ ALSO
Custom post type query creates blank infinite loop in shortcode

Custom post type query creates blank infinite loop in shortcode

Creating a shortcode that would pull a certain custom post typeUsing the_title() for test purposes

160
Rename a specific symbol on library include, to avoid the fatal error 'Cannot redeclare <function>'

Rename a specific symbol on library include, to avoid the fatal error 'Cannot redeclare <function>'

Was trying to include a library in a WordPress plugin, and I got

143
How is a+(read/append) different from a(append) in php

How is a+(read/append) different from a(append) in php

I am reading(and slowly trying) the ways to interact with a txt file in phpI have already tried append and it adds data to the end of the txt file But how is a+ different from a

133
replace php elements (image and name), onclick in js

replace php elements (image and name), onclick in js

php data variables (img, name, id, etcare populated from the database as a multidimensional array

174