diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb3a1eb..a50d8fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,6 +54,7 @@ jobs: - "8.2" - "8.3" - "8.4" + - "8.5" runs-on: ${{ matrix.os }} steps: diff --git a/README.md b/README.md index 3d84980..784a8ac 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ The framework that allows us to write PHP extensions using pure and safe Rust wh | | macOS | ✅ | | | Windows | ❌ | | **PHP Version** | 7.0 ~ 7.4 | ✅ | -| | 8.0 ~ 8.4 | ✅ | +| | 8.0 ~ 8.5 | ✅ | | **PHP Mode** | NTS | ✅ | | | ZTS | ❌ | | **SAPI** | CLI | ✅ | diff --git a/phper/Cargo.toml b/phper/Cargo.toml index 5791c67..600e246 100644 --- a/phper/Cargo.toml +++ b/phper/Cargo.toml @@ -44,6 +44,7 @@ unexpected_cfgs = { level = "warn", check-cfg = [ 'cfg(phper_minor_version, values("2"))', 'cfg(phper_minor_version, values("3"))', 'cfg(phper_minor_version, values("4"))', + 'cfg(phper_minor_version, values("5"))', 'cfg(phper_zts)', 'cfg(phper_enum_supported)', ] } diff --git a/phper/src/arrays.rs b/phper/src/arrays.rs index b017e61..cb7cdbb 100644 --- a/phper/src/arrays.rs +++ b/phper/src/arrays.rs @@ -11,6 +11,7 @@ //! Apis relate to [zend_array]. use crate::{alloc::EBox, strings::ZStr, sys::*, values::ZVal}; +use cfg_if::cfg_if; use derive_more::From; use phper_alloc::ToRefOwned; use std::{ @@ -463,9 +464,29 @@ impl<'a> Iterator for RawIter<'a> { &mut self.pos, ) as u32; - let iter_key = if result == HASH_KEY_IS_STRING { + const IS_STRING: u32 = { + cfg_if! { + if #[cfg(all(phper_major_version = "8", phper_minor_version = "5"))] { + zend_hash_key_type_HASH_KEY_IS_STRING + } else { + HASH_KEY_IS_STRING + } + } + }; + + const IS_LONG: u32 = { + cfg_if! { + if #[cfg(all(phper_major_version = "8", phper_minor_version = "5"))] { + zend_hash_key_type_HASH_KEY_IS_LONG + } else { + HASH_KEY_IS_LONG + } + } + }; + + let iter_key = if result == IS_STRING { IterKey::ZStr(ZStr::from_mut_ptr(str_index)) - } else if result == HASH_KEY_IS_LONG { + } else if result == IS_LONG { #[allow(clippy::unnecessary_cast)] IterKey::Index(num_index as u64) } else { @@ -473,6 +494,7 @@ impl<'a> Iterator for RawIter<'a> { return None; }; + #[allow(clippy::unnecessary_mut_passed)] let val = zend_hash_get_current_data_ex(self.arr, &mut self.pos); if val.is_null() { self.finished = true; diff --git a/phper/src/constants.rs b/phper/src/constants.rs index 0ca762e..50970cc 100644 --- a/phper/src/constants.rs +++ b/phper/src/constants.rs @@ -75,7 +75,7 @@ impl Constant { module_number, ) } - } + }; } } }