Skip to content

Conversation

@aaa2000
Copy link
Contributor

@aaa2000 aaa2000 commented Dec 4, 2025

Q A
Branch main
License MIT

This PR updates the GitHub Actions workflow to use the latest stable PHP version, 8.5, in the CI pipeline.

… is deprecated since 8.5, as it has no effect

As of PHP 8.1.0, calling this method has no effect; all properties are accessible by default.

@see https://www.php.net/manual/en/reflectionproperty.setaccessible.php
@see https://wiki.php.net/rfc/deprecations_php_8_5#extreflection_deprecations
ArrayObject::__construct(): Using an object as a backing array for ArrayObject is deprecated, as it allows violating class constraints and invariants
Method SplObjectStorage::contains() is deprecated since 8.5, use method SplObjectStorage::offsetExists() instead
Method SplObjectStorage::detach() is deprecated since 8.5, use method SplObjectStorage::offsetUnset() instead
@aaa2000
Copy link
Contributor Author

aaa2000 commented Dec 5, 2025

The error of the "PHPUnit + Behat (PHP 8.5) (MongoDB)" job is already present on the main branch.

The errors of others behat jobs appear to be related to the following deprecation https://wiki.php.net/rfc/warnings-php-8-5#coercing_nan_to_other_types

<response>
	<title>An error occurred</title>
	<detail>Warning: unexpected NAN value was coerced to string in
		/code/vendor/doctrine/dbal/src/Driver/PDO/Statement.php line 26
	</detail>
	<status>500</status>
	<type>/errors/500</type>
	<trace>
		<function>handleError</function>
		<class>Behat\Testwork\Call\Handler\RuntimeCallHandler</class>
		<type><![CDATA[->]]></type>
	</trace>
	<trace>
		<file>/code/vendor/doctrine/dbal/src/Driver/PDO/Statement.php</file>
		<line>26</line>
		<function>bindValue</function>
		<class>PDOStatement</class>
		<type><![CDATA[->]]></type>
	</trace>

When the value is NaN, INF, or -INF, PDO::bindValue with PDO::PARAM_STR appears to convert to a string and throw the warning Warning: unexpected NAN value was coerced to string

Note: These values ​​are not compatible with SQLite, the value is 0, unlike postgres.

<?xml version="1.0"?><response><id>2</id><myFloatField>NAN</myFloatField></response>
<?xml version="1.0"?><response><id>3</id><myFloatField>INF</myFloatField></response>
`<?xml version="1.0"?>\n<response><id>4</id><myFloatField>-INF</myFloatField></response>

no idea how to fix it... Should the test be ignored in PHP 8.5?

matrix:
php:
- '8.3'
- '8.5'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

php-cs-fixer doesn't support 8.5 yet can you lower to 8.4 maybe?

@soyuka
Copy link
Member

soyuka commented Dec 7, 2025

This failure is probably related to the changes:


--- Failed steps:

001 Example: | NaN   |                            # features/xml/deserialization.feature:74
      Then the response status code should be 201 # features/xml/deserialization.feature:68
        Current response status code is 500, but 201 expected. (Behat\Mink\Exception\ExpectationException)

839 scenarios (837 passed, 1 failed, 1 undefined)
5481 steps (5470 passed, 1 failed, 1 undefined, 9 skipped)
6m38.62s (324.02Mb)

Add a Then print last JSON response in there to know what's wrong. There are instructions in CONTRIBUTING.md if you need the commands to run the tests.

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.

2 participants