Writing functions
PHP is also known as a Glue language, and extending it, can be easily done with those extensions generators. When you use ext_skel and a prototype file to generate the C function stubs, you will notice that all of the exported functions created have a simple prototype such as the following: PHP_FUNCTION(func_name)
Коментарии
The 'l' spec expects a parameter of the type zend_long, not long anymore.
The 's' spec expects parameters of the type char * and size_t, no int anymore.
(c) https://github.com/php/php-src/blob/PHP-7.0.0/UPGRADING.INTERNALS#L75
To handle string parameters you should specify string length:
char *s1;
size_t s1_len;
char *s2;
size_t s2_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
&l, &s1, &s1_len, &s2 &s2_len) != SUCCESS) {
return;
}