Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Sort an array by key in ascending order
<?php ksort(array &$array, int $flags = SORT_REGULAR): true
<?php     private function assertSameAfterSorting($expected, $actual, $message = '')

    {

        if (is_array($expected)) {

            ksort($expected);

        }



        if (is_array($actual)) {
<?php         }



        if (is_array($actual)) {

            ksort($actual);

        }



        $this->assertSame($expected, $actual, $message);