From 44a0c089cad09e823945adff45c84f29a1f115f5 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Nahan <814683+macintoshplus@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:50:34 +0200 Subject: [PATCH 1/2] Fix PHP 8.5 build --- lua.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua.c b/lua.c index b05f4ef..3e8c1e2 100755 --- a/lua.c +++ b/lua.c @@ -868,7 +868,7 @@ PHP_MINIT_FUNCTION(lua) { INIT_CLASS_ENTRY(ce, "LuaException", NULL); - lua_exception_ce = zend_register_internal_class_ex(&ce, zend_exception_get_default()); + lua_exception_ce = zend_register_internal_class_ex(&ce, zend_ce_exception); return SUCCESS; } From e16624fd1c5e09f28ccd65cdce64dc9eb0959a4a Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Nahan <814683+macintoshplus@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:54:19 +0200 Subject: [PATCH 2/2] check php version --- lua.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua.c b/lua.c index 3e8c1e2..f9ad079 100755 --- a/lua.c +++ b/lua.c @@ -867,8 +867,11 @@ PHP_MINIT_FUNCTION(lua) { php_lua_closure_register(); INIT_CLASS_ENTRY(ce, "LuaException", NULL); - +#if PHP_VERSION_ID >= 80500 lua_exception_ce = zend_register_internal_class_ex(&ce, zend_ce_exception); +#else + lua_exception_ce = zend_register_internal_class_ex(&ce, zend_exception_get_default()); +#endif return SUCCESS; }