Deprecated backtick operator with shell_exec() for PHP 8.5#267
Deprecated backtick operator with shell_exec() for PHP 8.5#267alfsb merged 3 commits intophp:masterfrom
Conversation
|
Missed one backtick on line 590. But as you are at it, the code between 578-600 is about to be deleted. It was written to debug a strange situation where GitHub CI is giving different results before and after merging. In the end, GitHub CI never guarantees the same result before/after merging, because CI ignores changes on master by default. I wrote it, you can delete it. |
There was a problem hiding this comment.
Pull request overview
This PR updates the configure.php file to replace deprecated backtick operators with shell_exec() calls in preparation for PHP 8.5, where the backtick operator is officially deprecated. The changes affect git command executions that fetch repository metadata during the build process.
Key Changes:
- Replaced three backtick operator usages with
shell_exec()calls on lines 593-595 - Updated quote escaping for git format string to use escaped double quotes
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Tested on Linux and Windows. Appears to be ok. Let's give a few weeks for possible other reviews. |
|
Thanks @alfsb! |
|
I'm retracting what I said about deleting this code. It was useful literally yesterday for solving another problem. So, even though it didn't fulfill its original purpose, it still has uses. After the merge, I'll just tidy it up and simplify it, but it will basically be kept. |
This PR replaces the use of the backtick operator (
`cmd`), which is officially deprecated as of PHP 8.5.Reference:
The affected calls fetch Git metadata during the build process. Using
shell_exec()is semantically identical and avoids E_DEPRECATED notices on PHP 8.5.Behavior and output remain unchanged. Tested with PHP 8.3, 8.4 and 8.5.