Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Binary safe string comparison
<?php strcmp(string $string1, string $string2): int
<?php                     } else {

                        $result = match ($options) {

                            SORT_NUMERIC => intval($values[0]) <=> intval($values[1]),

                            SORT_STRING => strcmp($values[0], $values[1]),

                            SORT_NATURAL => strnatcmp($values[0], $values[1]),

                            SORT_LOCALE_STRING => strcoll($values[0], $values[1]),

                            default => $values[0] <=> $values[1],
<?php         }



        return is_numeric($attribute) && is_numeric($original)

            && strcmp((string) $attribute, (string) $original) === 0;

    }