Skip to content

Commit 0408c24

Browse files
nickschuchjmjoy
andauthored
Adds 8.5 (#225)
Co-authored-by: jmjoy <jmjoy@apache.org>
1 parent fb509c4 commit 0408c24

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
- "8.2"
5555
- "8.3"
5656
- "8.4"
57+
- "8.5"
5758

5859
runs-on: ${{ matrix.os }}
5960
steps:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The framework that allows us to write PHP extensions using pure and safe Rust wh
3838
| | macOS ||
3939
| | Windows ||
4040
| **PHP Version** | 7.0 ~ 7.4 ||
41-
| | 8.0 ~ 8.4 ||
41+
| | 8.0 ~ 8.5 ||
4242
| **PHP Mode** | NTS ||
4343
| | ZTS ||
4444
| **SAPI** | CLI ||

phper/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ unexpected_cfgs = { level = "warn", check-cfg = [
4444
'cfg(phper_minor_version, values("2"))',
4545
'cfg(phper_minor_version, values("3"))',
4646
'cfg(phper_minor_version, values("4"))',
47+
'cfg(phper_minor_version, values("5"))',
4748
'cfg(phper_zts)',
4849
'cfg(phper_enum_supported)',
4950
] }

phper/src/arrays.rs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
//! Apis relate to [zend_array].
1212
1313
use crate::{alloc::EBox, strings::ZStr, sys::*, values::ZVal};
14+
use cfg_if::cfg_if;
1415
use derive_more::From;
1516
use phper_alloc::ToRefOwned;
1617
use std::{
@@ -463,16 +464,37 @@ impl<'a> Iterator for RawIter<'a> {
463464
&mut self.pos,
464465
) as u32;
465466

466-
let iter_key = if result == HASH_KEY_IS_STRING {
467+
const IS_STRING: u32 = {
468+
cfg_if! {
469+
if #[cfg(all(phper_major_version = "8", phper_minor_version = "5"))] {
470+
zend_hash_key_type_HASH_KEY_IS_STRING
471+
} else {
472+
HASH_KEY_IS_STRING
473+
}
474+
}
475+
};
476+
477+
const IS_LONG: u32 = {
478+
cfg_if! {
479+
if #[cfg(all(phper_major_version = "8", phper_minor_version = "5"))] {
480+
zend_hash_key_type_HASH_KEY_IS_LONG
481+
} else {
482+
HASH_KEY_IS_LONG
483+
}
484+
}
485+
};
486+
487+
let iter_key = if result == IS_STRING {
467488
IterKey::ZStr(ZStr::from_mut_ptr(str_index))
468-
} else if result == HASH_KEY_IS_LONG {
489+
} else if result == IS_LONG {
469490
#[allow(clippy::unnecessary_cast)]
470491
IterKey::Index(num_index as u64)
471492
} else {
472493
self.finished = true;
473494
return None;
474495
};
475496

497+
#[allow(clippy::unnecessary_mut_passed)]
476498
let val = zend_hash_get_current_data_ex(self.arr, &mut self.pos);
477499
if val.is_null() {
478500
self.finished = true;

phper/src/constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl Constant {
7575
module_number,
7676
)
7777
}
78-
}
78+
};
7979
}
8080
}
8181
}

0 commit comments

Comments
 (0)