Bug #79653 [Ver->Csd]: Unexpected error for ArrayIterator::ksort()

From: Date: Sat, 30 May 2020 15:00:30 +0000
Subject: Bug #79653 [Ver->Csd]: Unexpected error for ArrayIterator::ksort()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-227249@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79653&edit=1 ID: 79653 Updated by: kocsismate@php.net Reported by: admad dot coder at gmail dot com Summary: Unexpected error for ArrayIterator::ksort() -Status: Verified +Status: Closed Type: Bug Package: SPL related Operating System: Linux PHP Version: master-Git-2020-05-29 (Git) Assigned To: kocsismate Block user comment: N Private report: N New Comment: Automatic comment on behalf of kocsismate@woohoolabs.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=4a10eb4f53dbe1b543e9043fd2e249200291abcc Log: Fix #79653 Unexpected error for ArrayIterator::ksort() Previous Comments: ------------------------------------------------------------------------ [2020-05-30 09:16:32] kocsismate@php.net The following pull request has been associated: Patch Name: Fix #79653 Unexpected error for ArrayIterator::ksort() On GitHub: https://github.com/php/php-src/pull/5644 Patch: https://github.com/php/php-src/pull/5644.patch ------------------------------------------------------------------------ [2020-05-30 09:05:39] kocsismate@php.net Uh, I think the browser autocomplete messed up the title, sorry. ------------------------------------------------------------------------ [2020-05-30 09:02:26] kocsismate@php.net Thank you for reporting the issue! I managed to verify the problem, which was caused by a refactoring. ------------------------------------------------------------------------ [2020-05-30 06:25:32] admad dot coder at gmail dot com Description: ------------ Using ArrayIterator::ksort() without any arguments generates ArgumentCountError error. Issue seems related to implementation of this feature request https://bugs.php.net/bug.php?id=62840. Test script: --------------- <?php $array = []; $arrIter = new ArrayIterator($array); $arrIter->ksort(); Expected result: ---------------- As per https://github.com/php/php-src/blob/4fa3687e56050a111e8eaffe330258003628225e/ext/spl/spl_array.stub.php#L191 the new $sort_flags arguments has a default value. (In PHP 7 the method does not have any arguments). So I do not expect any error to be generated when calling the method without any argument. Actual result: -------------- Above example code generate error like: Fatal error: Uncaught ArgumentCountError: ArrayIterator::ksort() expects exactly 1 parameter, 0 given ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=79653&edit=1

« previous php.bugs (#227249) next »