zephir-lang / zephir

Zephir is a compiled high-level language aimed to ease the creation of C-extensions for PHP
https://zephir-lang.com
MIT License
3.3k stars 466 forks source link

error when compiling on php 8.2.0 #2399

Closed Dichvucoder closed 1 year ago

Dichvucoder commented 1 year ago

When compiling on php 8.2.0 I get the following error:

/home/works/dichvucoder/ext/kernel/main.c:571:34: error: too many arguments to function call, expected 0, have 1 if (zend_forbid_dynamic_call("func_get_arg()") == FAILURE)

And

/home/works/dichvucoder/ext/kernel/fcall.c:699:58: error: too few arguments to function call, expected 3, have 2 new_op_array = zend_compile_string(Z_STR_P(str), context);

I tried compiling again on php 7.4.33 and 8.1.6 it still works it seems these 2 errors only appear on php 8.2.0 How to fix it?

aprokopenko commented 1 year ago

Similar results on PHP 8.2.2: (Tried to install zephir_parser as pecl and compile from source with phpize)

/var/www/html/ext/kernel/main.c: In function 'zephir_function_exists':
/var/www/html/ext/kernel/main.c:285:101: warning: comparison between pointer and integer
  if (zend_hash_str_exists(CG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)) != NULL) {
                                                                                                     ^~
/var/www/html/ext/kernel/main.c: In function 'zephir_function_exists_ex':
/var/www/html/ext/kernel/main.c:301:76: warning: comparison between pointer and integer
  if (zend_hash_str_exists(CG(function_table), function_name, function_len) != NULL) {
                                                                            ^~
/var/www/html/ext/kernel/main.c: In function 'zephir_get_arg':
/var/www/html/ext/kernel/main.c:571:9: error: too many arguments to function 'zend_forbid_dynamic_call'
     if (zend_forbid_dynamic_call("func_get_arg()") == FAILURE) {
         ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/php/main/php.h:35,
                 from /var/www/html/ext/kernel/main.c:16:
/usr/local/include/php/Zend/zend_API.h:782:39: note: declared here
 static zend_always_inline zend_result zend_forbid_dynamic_call(void)
                                       ^~~~~~~~~~~~~~~~~~~~~~~~

Any estimates on fixing this issue?

Jeckerson commented 1 year ago

Fixed in 0.17.0