Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

The PHP version check in prepare.php still allows PHP 7.2 and 7.3

未关闭 适合新手
#359 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

@ekamran 已经在做这个了。

开始于 2026年10月19日。

  • #360 来自 @ekamran —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
php
领域
cli

调研方向

从 issue 中描述的 PHP 版本检查处开始查看 prepare.php,然后读取已准备好的 checkout 中 src/wp-includes/version.php 的 $required_php_version。使用 PHP 7.3.33 和 WPT_PHP_EXECUTABLE 重现报告的情况;完成标准是检查在依赖项安装开始前,以清晰的消息拒绝低于 WordPress 最低版本要求的版本。

由索引模型根据 Issue 内容生成。

描述

prepare.php stops a run when the test environment's PHP is older than 7.2:

if ( version_compare( $env_php_version, '7.2', '<' ) ) {

7.2 was the WordPress minimum when the check was last raised in 33584bb. WordPress 7.0 raised the minimum to PHP 7.4 (r61459, #62622), and the README here already lists PHP 7.4+, but the check still lets 7.2 and 7.3 through.

I ran prepare.php from master (31185de) against current trunk with WPT_PHP_EXECUTABLE pointing to a script that reports PHP 7.3.33. The check passed, the run cloned wordpress-develop, ran npm install and the build, and then stopped in Composer:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires php >=7.4 but your php version (7.3.33; overridden via config.platform, actual: 8.5.11) does not satisfy that requirement.

So a host on PHP 7.2 or 7.3 gets a dependency error after the build, instead of a message that its PHP version is too old.

WordPress keeps its minimum in $required_php_version in src/wp-includes/version.php, which is already in the prepared checkout. Reading it from there would keep the check in line with WordPress without editing it again. I have a fix and will open a pull request.

主要语言
PHP
星标
77
派生
79
平均合并
9 天 2 小时
30 天内合并 PR
5

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

WordPress/phpunit-test-runner 的其他 Issue

查看 WordPress/phpunit-test-runner 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。