Bug #65317
Epic #65314: PHP7
TypoScriptParserTest::executeValueModifierReturnsModifiedResult
Status: | Under Review | Start date: | 2015-02-25 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | - | Spent time: | - | |
Target version: | 7 LTS | |||
TYPO3 Version: | 6.2 | Is Regression: | No | |
PHP Version: | 7.0 | Sprint Focus: | ||
Complexity: |
Description
TYPO3\CMS\Core\Tests\Unit\TypoScript\Parser\TypoScriptParserTest::executeValueModifierReturnsModifiedResult with data set "sortList sorts a list numeric descending" ('sortList', '10,100,0,20,abc,-20', 'descending,numeric', '100,20,10,0,abc,-20') Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'100,20,10,0,abc,-20' +'100,20,10,abc,0,-20' /home/opitz/projects/typo3-master/typo3-src/typo3/sysext/core/Tests/Unit/TypoScript/Parser/TypoScriptParserTest.php:227 /home/opitz/projects/neos-git/Packages/Libraries/phpunit/phpunit/phpunit7:56
=> sort, internally same issue on swap?
=> Same on HHVM
History
#1 Updated by Alexander Opitz 5 months ago
- Description updated (diff)
#2 Updated by Alexander Opitz 5 months ago
- Description updated (diff)
#3 Updated by Alexander Opitz 2 months ago
- Status changed from New to Accepted
This issue can be forced in the other tests for sortList, by rearranging the $currentValue in the data provider.
From the PHP documentation of sort
Warning Be careful when sorting arrays with mixed types values because sort() can produce unpredictable results.
And that's what we get here, as the sorting algorithms are different between PHP5.x and PHP7/HHVM.
By definition of the function the result is not defined.
We have 2 Options:
- Implement a proper solution (which is maybe not so fast)
- Change meaning/documentation of sortList in TypoScript
#4 Updated by Gerrit Code Review 5 days ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42112
#5 Updated by Gerrit Code Review 5 days ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42112