Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
php: ["8.0", "8.1", "8.2", "8.3"]
php: ["8.0", "8.1", "8.2", "8.3", "8.4"]
rust: [stable, nightly]
clang: ["15", "17"]
phpts: [ts, nts]
Expand Down
12 changes: 10 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use bindgen::RustTarget;
use impl_::Provider;

const MIN_PHP_API_VER: u32 = 20200930;
const MAX_PHP_API_VER: u32 = 20230831;
const MAX_PHP_API_VER: u32 = 20240924;

pub trait PHPProvider<'a>: Sized {
/// Create a new PHP provider.
Expand Down Expand Up @@ -230,7 +230,11 @@ fn check_php_version(info: &PHPInfo) -> Result<()> {

const PHP_83_API_VER: u32 = 20230831;

println!("cargo::rustc-check-cfg=cfg(php80, php81, php82, php83, php_zts, php_debug, docs)");
const PHP_84_API_VER: u32 = 20240924;

println!(
"cargo::rustc-check-cfg=cfg(php80, php81, php82, php83, php84, php_zts, php_debug, docs)"
);
println!("cargo:rustc-cfg=php80");

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

if version >= PHP_84_API_VER {
println!("cargo:rustc-cfg=php84");
}

Ok(())
}

Expand Down
8 changes: 8 additions & 0 deletions src/builders/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ impl<'a> FunctionBuilder<'a> {
arg_info: ptr::null(),
num_args: 0,
flags: 0, // TBD?
#[cfg(php84)]
doc_comment: ptr::null(),
#[cfg(php84)]
frameless_function_infos: ptr::null(),
},
args: vec![],
n_req: None,
Expand All @@ -79,6 +83,10 @@ impl<'a> FunctionBuilder<'a> {
arg_info: ptr::null(),
num_args: 0,
flags: MethodFlags::Abstract.bits(),
#[cfg(php84)]
doc_comment: ptr::null(),
#[cfg(php84)]
frameless_function_infos: ptr::null(),
},
args: vec![],
n_req: None,
Expand Down
4 changes: 4 additions & 0 deletions src/zend/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ impl FunctionEntry {
arg_info: ptr::null(),
num_args: 0,
flags: 0,
#[cfg(php84)]
doc_comment: ptr::null(),
#[cfg(php84)]
frameless_function_infos: ptr::null(),
}
}

Expand Down
15 changes: 12 additions & 3 deletions src/zend/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,18 @@ impl ZendObjectHandlers {
let mut zv = Zval::new();
val.get(self_, &mut zv)?;

#[allow(clippy::unnecessary_mut_passed)]
if zend_is_true(&mut zv) == 1 {
return Ok(1);
cfg_if::cfg_if! {
if #[cfg(php84)] {
#[allow(clippy::unnecessary_mut_passed)]
if zend_is_true(&mut zv) == true {
return Ok(1);
}
} else {
#[allow(clippy::unnecessary_mut_passed)]
if zend_is_true(&mut zv) == 1 {
return Ok(1);
}
}
}
}
}
Expand Down
Loading