longxinH / xhprof

PHP7/PHP8 support
http://pecl.php.net/package/xhprof
Apache License 2.0
1.09k stars 167 forks source link

Won't compile against PHP 7.2 #4

Closed langemeijer closed 6 years ago

langemeijer commented 6 years ago

Compiling to 7.2 I get:

/root/pecl-packages/xhprof/build-7.2/xhprof.c:890:44: error: too many arguments to function 'php_pcre_replace_impl'
                         zend_string *res = php_pcre_replace_impl(pce_regexp, NULL, Z_STRVAL(tmp_zv), Z_STRLEN(tmp_zv), &repl, 0, 1, 0);
                                            ^

This is a change in php_pcre_replace_impl, as documented here: https://raw.githubusercontent.com/php/php-src/PHP-7.2.0/UPGRADING.INTERNALS under '3. Module changes':

. php_pcre_replace and php_pcre_replace_impl expect a zend_string instead of a zval and is_callable_replace options is removed:

  • PHPAPI zend_string php_pcre_replace(zend_string regex, zend_string subject_str, char subject, int subject_len, zend_string replace_str, int limit, int replace_count);
  • PHPAPI zend_string php_pcre_replace_impl(pcre_cache_entry pce, zend_string subject_str, char subject, int subject_len, zend_string replace_str, int limit, int replace_count);
longxinH commented 6 years ago

fixed