Skip to content

Commit 464407b

Browse files
authored
chore(php): add deprecation warning for php 8.0 (#353)
* chore(php): Add deprecation warning for php 8.0 Refs: #343 * docs(php): add information about supported php versions
1 parent a493b8b commit 464407b

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Export a simple function `function hello_world(string $name): string` to PHP:
2222
use ext_php_rs::prelude::*;
2323

2424
/// Gives you a nice greeting!
25-
///
25+
///
2626
/// @param string $name Your name.
27-
///
27+
///
2828
/// @return string Nice greeting!
2929
#[php_function]
3030
pub fn hello_world(name: String) -> String {
@@ -114,8 +114,12 @@ best resource at the moment. This can be viewed at [docs.rs].
114114
## Requirements
115115

116116
- Linux, macOS or Windows-based operating system.
117-
- PHP 8.0 or later.
117+
- PHP 8.1 or later.
118118
- No support is planned for earlier versions of PHP.
119+
- PHP versions, that no longer receive security updates, will no longer be
120+
supported. They might still work, but no guarantees are made.
121+
- See <https://www.php.net/supported-versions.php> for information on PHP
122+
supported versions and their end of life dates.
119123
- Rust.
120124
- Currently, we maintain no guarantee of a MSRV, however lib.rs suggests Rust
121125
1.57 at the time of writing.

build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ fn check_php_version(info: &PHPInfo) -> Result<()> {
237237
);
238238
println!("cargo:rustc-cfg=php80");
239239

240+
if (MIN_PHP_API_VER..PHP_81_API_VER).contains(&version) {
241+
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.");
242+
}
243+
240244
if (PHP_81_API_VER..PHP_82_API_VER).contains(&version) {
241245
println!("cargo:rustc-cfg=php81");
242246
}

0 commit comments

Comments
 (0)