Skip to content

Commit 08501f7

Browse files
authored
chore(cfg): change php81 cfg to 8.1+ (#365)
1 parent e9eeaef commit 08501f7

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ fn check_php_version(info: &PHPInfo) -> Result<()> {
241241
println!("cargo:warning=PHP version 8.0 is EOL and will no longer be supported in a future release. Please upgrade to a supported version of PHP. See https://www.php.net/supported-versions.php for information on version support timelines.");
242242
}
243243

244-
if (PHP_81_API_VER..PHP_82_API_VER).contains(&version) {
244+
if version >= PHP_81_API_VER {
245245
println!("cargo:rustc-cfg=php81");
246246
}
247247

@@ -285,6 +285,7 @@ fn main() -> Result<()> {
285285
if env::var("DOCS_RS").is_ok() {
286286
println!("cargo:warning=docs.rs detected - using stub bindings");
287287
println!("cargo:rustc-cfg=php_debug");
288+
println!("cargo:rustc-cfg=php81");
288289
println!("cargo:rustc-cfg=php82");
289290
std::fs::copy("docsrs_bindings.rs", out_path)
290291
.expect("failed to copy docs.rs stub bindings to out directory");

src/builders/class.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl ClassBuilder {
247247
// disable serialization if the class has an associated object
248248
if self.object_override.is_some() {
249249
cfg_if::cfg_if! {
250-
if #[cfg(any(php81, php82))] {
250+
if #[cfg(php81)] {
251251
class.ce_flags |= ClassFlags::NotSerializable.bits();
252252
} else {
253253
class.serialize = Some(crate::ffi::zend_class_serialize_deny);

src/flags.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ bitflags! {
9191
const UnresolvedVariance = ZEND_ACC_UNRESOLVED_VARIANCE;
9292
const NearlyLinked = ZEND_ACC_NEARLY_LINKED;
9393

94-
#[cfg(any(php81,php82))]
94+
#[cfg(php81)]
9595
const NotSerializable = crate::ffi::ZEND_ACC_NOT_SERIALIZABLE;
9696
}
9797
}

0 commit comments

Comments
 (0)