Skip to content

Commit 2f9a321

Browse files
committed
added PHP8.4
1 parent a54954c commit 2f9a321

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

build.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use bindgen::RustTarget;
1616
use impl_::Provider;
1717

1818
const MIN_PHP_API_VER: u32 = 20200930;
19-
const MAX_PHP_API_VER: u32 = 20230831;
19+
const MAX_PHP_API_VER: u32 = 20240924;
2020

2121
pub trait PHPProvider<'a>: Sized {
2222
/// Create a new PHP provider.
@@ -230,7 +230,9 @@ fn check_php_version(info: &PHPInfo) -> Result<()> {
230230

231231
const PHP_83_API_VER: u32 = 20230831;
232232

233-
println!("cargo::rustc-check-cfg=cfg(php80, php81, php82, php83, php_zts, php_debug, docs)");
233+
const PHP_84_API_VER: u32 = 20240924;
234+
235+
println!("cargo::rustc-check-cfg=cfg(php80, php81, php82, php83, php84, php_zts, php_debug, docs)");
234236
println!("cargo:rustc-cfg=php80");
235237

236238
if (PHP_81_API_VER..PHP_82_API_VER).contains(&version) {
@@ -245,6 +247,10 @@ fn check_php_version(info: &PHPInfo) -> Result<()> {
245247
println!("cargo:rustc-cfg=php83");
246248
}
247249

250+
if version >= PHP_84_API_VER {
251+
println!("cargo:rustc-cfg=php84");
252+
}
253+
248254
Ok(())
249255
}
250256

src/builders/function.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ impl<'a> FunctionBuilder<'a> {
5858
arg_info: ptr::null(),
5959
num_args: 0,
6060
flags: 0,
61+
#[cfg(php84)]
6162
frameless_function_infos: ptr::null(),
63+
#[cfg(php84)]
6264
doc_comment: "".as_ptr() as *const c_char,
6365
},
6466
args: vec![],
@@ -84,7 +86,9 @@ impl<'a> FunctionBuilder<'a> {
8486
arg_info: ptr::null(),
8587
num_args: 0,
8688
flags: MethodFlags::Abstract.bits(),
89+
#[cfg(php84)]
8790
frameless_function_infos: ptr::null(),
91+
#[cfg(php84)]
8892
doc_comment: "".as_ptr() as *const c_char,
8993
},
9094
args: vec![],

src/zend/function.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ impl FunctionEntry {
3838
arg_info: ptr::null(),
3939
num_args: 0,
4040
flags: 0,
41+
#[cfg(php84)]
4142
frameless_function_infos: ptr::null(),
43+
#[cfg(php84)]
4244
doc_comment: "".as_ptr() as *const c_char,
43-
// pub frameless_function_infos: *const zend_frameless_function_info,
44-
// pub doc_comment: *const ::std::os::raw::c_char,
4545
}
4646
}
4747

src/zend/handlers.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,16 @@ impl ZendObjectHandlers {
238238
let mut zv = Zval::new();
239239
val.get(self_, &mut zv)?;
240240

241+
#[cfg(php84)]
241242
#[allow(clippy::unnecessary_mut_passed)]
242243
if zend_is_true(&mut zv) {
243244
return Ok(1);
244245
}
246+
247+
#[cfg(not(php84))]
248+
if zend_is_true(&mut zv) == 1 {
249+
return Ok(1);
250+
}
245251
}
246252
}
247253
//

0 commit comments

Comments
 (0)