Skip to content

Commit 41ddbdc

Browse files
committed
Add more php version.
1 parent 637af8f commit 41ddbdc

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
os:
2222
- ubuntu-latest
2323
php-version:
24+
- 7.1
25+
- 7.2
2426
- 7.3
2527
- 7.4
2628

@@ -31,6 +33,9 @@ jobs:
3133
with:
3234
php-version: ${{ matrix.php-version }}
3335

36+
- name: PHP Config
37+
run: php-config --version && php-config --phpapi
38+
3439
- name: Checkout
3540
uses: actions/checkout@v2
3641

phper/src/zend/api.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,16 @@ impl<T: 'static> ModuleGlobals<T> {
3434
on_modify: Option<Mh>,
3535
modifiable: u32,
3636
) -> zend_ini_entry_def {
37-
#[cfg(phper_php_version = "7.3")]
38-
let modifiable = modifiable as std::os::raw::c_uchar;
39-
#[cfg(phper_php_version = "7.2")]
40-
let modifiable = modifiable as std::os::raw::c_int;
41-
42-
#[cfg(phper_php_version = "7.3")]
43-
let name_length = name.len() as u16;
44-
#[cfg(phper_php_version = "7.2")]
45-
let name_length = name.len() as u32;
37+
#[cfg(any(
38+
phper_php_version = "7.4",
39+
phper_php_version = "7.3",
40+
))]
41+
let (modifiable, name_length) = (modifiable as std::os::raw::c_uchar, name.len() as u16);
42+
#[cfg(any(
43+
phper_php_version = "7.2",
44+
phper_php_version = "7.1",
45+
))]
46+
let (modifiable, name_length) = (modifiable as std::os::raw::c_int, name.len() as u32);
4647

4748
zend_ini_entry_def {
4849
name: name.as_ptr().cast(),

0 commit comments

Comments
 (0)