Skip to content

Conversation

@dmygzs
Copy link

@dmygzs dmygzs commented Mar 23, 2025

修复了 array_reduce() 函数使用时可能引发的警告问题。原代码中,$posts 变量可能为 null 或未定义,直接将其传递给 array_reduce() 会导致 PHP 抛出警告信息。为了增强代码的健壮性,添加了对 $posts 的检查逻辑,确保其已设置且为数组后再执行 array_reduce() 操作。

dmygzs added 2 commits March 23, 2025 17:34
修复了 array_reduce() 函数使用时可能引发的警告问题。原代码中,$posts 变量可能为 null 或未定义,直接将其传递给 array_reduce() 会导致 PHP 抛出警告信息。为了增强代码的健壮性,添加了对 $posts 的检查逻辑,确保其已设置且为数组后再执行 array_reduce() 操作。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant