Skip to content

Add PHP 7.4+ support#4

Merged
daedeloth merged 3 commits intomasterfrom
copilot/add-php-7-4-support
Mar 6, 2026
Merged

Add PHP 7.4+ support#4
daedeloth merged 3 commits intomasterfrom
copilot/add-php-7-4-support

Conversation

Copy link
Contributor

Copilot AI commented Mar 6, 2026

  • Update composer.json: change PHP requirement from >=8.1.0 to >=7.4, add PHPUnit ^9.5 to dev requirement
  • Update tests/DbQueryTest.php: replace #[Group('database')] attribute (PHP 8.0+) with @group database docblock annotation (compatible with PHPUnit 9+)
  • Update phpunit.xml: remove cacheDirectory attribute (PHPUnit 10+ only) and <source> element (PHPUnit 10+ only) to be compatible with PHPUnit 9.x
  • Update .github/workflows/tests.yml: add PHP 7.4 and 8.0 to the test matrix
  • Fix PHP 7.4 test failures: change $value == 'true' to strict $value === 1 || $value === '1' || $value === 'true' in Tools::checkInput() — in PHP 7.4, 0 == 'true' incorrectly evaluated to true due to non-numeric strings being cast to 0 before loose integer comparison
Original prompt

This section details on the original issue you should resolve

<issue_title>We must support php 7.4</issue_title>
<issue_description>Code is ancient; supporting 7.4 should be trivial.
Add a 7.4 test runner as well; perhaps add a bunch more versions between 7.4 and 8.0</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: daedeloth <1168599+daedeloth@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for PHP 7.4 and test runner Add PHP 7.4+ support Mar 6, 2026
@daedeloth
Copy link
Member

@copilot fix failing tests

Co-authored-by: daedeloth <1168599+daedeloth@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 6, 2026

@copilot fix failing tests

Fixed in e158dc3. The failures were in testBoolCheckInput and testBoolGetInput — in PHP 7.4, 0 == 'true' evaluated to true because non-numeric strings were cast to 0 before loose integer comparison, making checkInput(0, 'bool') incorrectly return true. Fixed by switching to strict comparisons: $value === 1 || $value === '1' || $value === 'true'.

@daedeloth daedeloth marked this pull request as ready for review March 6, 2026 12:22
@daedeloth daedeloth merged commit 713c172 into master Mar 6, 2026
5 checks passed
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.

We must support php 7.4

2 participants