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

Build fails with PHP 8.4 #184

Open
petk opened this issue Aug 18, 2024 · 4 comments · May be fixed by #185
Open

Build fails with PHP 8.4 #184

petk opened this issue Aug 18, 2024 · 4 comments · May be fixed by #185

Comments

@petk
Copy link
Contributor

petk commented Aug 18, 2024

On PHP 8.4 the exit() RFC was implemented and the uopz needs to be adjusted.

phpize
./configure
make

Produces:

/uopz/src/handlers.c:127:20: error: 'ZEND_EXIT' undeclared here (not in a function); did you mean 'ZEND_CAST'?
  127 |  UOPZ_HANDLER_DECL(ZEND_EXIT,     exit)
      |                    ^~~~~~~~~
/uopz/src/handlers.c:81:35: note: in definition of macro 'UOPZ_HANDLER_DECL'
   81 | #define UOPZ_HANDLER_DECL(o, n)  {o, &zend_vm_##n, uopz_vm_##n},
      |                                   ^
make: *** [Makefile:215: src/handlers.lo] Error 1
make: *** Waiting for unfinished jobs....
@cmb69
Copy link
Collaborator

cmb69 commented Aug 18, 2024

For what it's worth, see https://news-web.php.net/php.internals/124783, which has some hints on how to keep uopz compatible with PHP 8.4.

@zonuexe zonuexe linked a pull request Nov 23, 2024 that will close this issue
@zonuexe
Copy link

zonuexe commented Nov 23, 2024

For those looking for a quick way to build uopz with PHP 8.4:

Applying this patch b2791e0 will make it possible to build, but exit() will always be enabled and will not be affected by uopz_allow_exit() and ini(uopz.exit).

@zonuexe
Copy link

zonuexe commented Nov 23, 2024

In my opinion, it would be easier for uopz to declare that the exit feature is not supported for PHP 8.4 and have users who need it configure the following code:

uopz_add_function('exit', function () {});
uopz_add_function('die', function () {});

@cmb69
Copy link
Collaborator

cmb69 commented Nov 24, 2024

It seems to me that #185 is a nice solution. It works with PHP 8.4 like it worked before, but still users can use uopz_set_return() to mock exit() calls.

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

Successfully merging a pull request may close this issue.

3 participants