Skip to content

修复了 array_reduce() 函数 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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