Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken compatability with PHP 8.1+ #374

Open
blizzard4591 opened this issue Oct 26, 2023 · 0 comments
Open

Broken compatability with PHP 8.1+ #374

blizzard4591 opened this issue Oct 26, 2023 · 0 comments

Comments

@blizzard4591
Copy link

Dear maintainers,

the file ScriptEngine/php_sapi.cpp says it is compatible with PHP 8.1 and changes to that end seem to have been made, but when compiling, this happens:

ScriptEngine/php_sapi.cpp: In function ‘zend_result hg_stream_open(const char*, zend_file_handle*)’:
ScriptEngine/php_sapi.cpp:468:26: error: cannot convert ‘const char*’ to ‘zend_string*’ {aka ‘_zend_string*’} in assignment
  468 |       handle->filename = filename;
      |                          ^~~~~~~~
      |                          |
      |                          const char*
ScriptEngine/php_sapi.cpp:524:28: error: cannot convert ‘const char*’ to ‘zend_string*’ {aka ‘_zend_string*’} in assignment
  524 |         handle->filename = filename;
      |                            ^~~~~~~~
      |                            |
      |                            const char*
ScriptEngine/php_sapi.cpp:546:26: error: cannot convert ‘const char*’ to ‘zend_string*’ {aka ‘_zend_string*’} in argument passing
  546 |     auto fp = zend_fopen(filename, &opened_path);
      |                          ^~~~~~~~
      |                          |
      |                          const char*
ScriptEngine/php_sapi.cpp: In function ‘int php_homegear_startup(sapi_module_struct*)’:
ScriptEngine/php_sapi.cpp:2694:31: error: invalid conversion from ‘zend_result (*)(const char*, zend_file_handle*)’ {aka ‘ZEND_RESULT_CODE (*)(const char*, _zend_file_handle*)’} to ‘zend_result (*)(zend_file_handle*)’ {aka ‘ZEND_RESULT_CODE (*)(_zend_file_handle*)’} [-fpermissive]
 2694 |   zend_stream_open_function = hg_stream_open;
      |                               ^~~~~~~~~~~~~~
      |                               |
      |                               zend_result (*)(const char*, zend_file_handle*) {aka ZEND_RESULT_CODE (*)(const char*, _zend_file_handle*)}

Looking at the Zend release notes at https://raw.githubusercontent.com/php/php-src/PHP-8.1/UPGRADING.INTERNALS, we can see:
zend_file_handle.filename now is zend_string*

Am I doing something wrong? I used PHP 8.1.24 built from source using the instructions at https://doc.homegear.eu/homegear/installation.html#compiling-from-source.

Sadly, I have no idea how to fix this, i.e. how to get a zend_string from a std::string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant