strcmp

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;

    }
<?php         $two = Str::lower($two);



        if (! class_exists(Collator::class)) {

            return strcmp($one, $two);

        }



        return (new Collator($this->locale))->compare($one, $two);
<?php             $rootRequires = $this->getRootRequires();

            $packages = $installedRepo->getPackages();

            usort($packages, function (BasePackage $a, BasePackage $b) {

                return strcmp((string) $a, (string) $b);

            });

            $arrayTree = array();

            foreach ($packages as $package) {
<?php         $phar->startBuffering();



        $finderSort = function ($a, $b) {

            return strcmp(strtr($a->getRealPath(), '\\', '/'), strtr($b->getRealPath(), '\\', '/'));

        };
<?php         }



        usort($usedAliases, function ($a, $b) {

            return strcmp($a['package'], $b['package']);

        });



        return $usedAliases;
<?php                     return $a instanceof AliasPackage ? -1 : 1;

                }


                return strcmp($b->getVersion(), $a->getVersion());

            }



            return strcmp($b->getName(), $a->getName());
<?php                 return strcmp($b->getVersion(), $a->getVersion());

            }



            return strcmp($b->getName(), $a->getName());

        };



        $this->resultPackageMap = array();
<?php                 $b = $b->getPackage()->getName();

            }



            return strcmp($a, $b);

        };

        usort($uninstalls, $sortByName);

        usort($installsUpdates, $sortByName);
<?php         }



        usort($locked, function ($a, $b) {

            $comparison = strcmp($a['name'], $b['name']);



            if (0 !== $comparison) {

                return $comparison;
<?php             }




            return strcmp($a['version'], $b['version']);

        });



        return $locked;
<?php         sort($data['dev-package-names']);

        usort($data['packages'], function ($a, $b) {

            return strcmp($a['name'], $b['name']);

        });



        $this->file->write($data);
<?php     public function isStream()

    {

        return is_string($this->p4DepotType) && (strcmp($this->p4DepotType, 'stream') === 0);

    }
<?php             $resArray = explode(PHP_EOL, $result);

            foreach ($resArray as $line) {

                $fields = explode('=', $line);

                if (strcmp($name, $fields[0]) == 0) {

                    $index = strpos($fields[1], ' ');

                    if ($index === false) {

                        $value = $fields[1];
<?php         foreach ($resArray as $line) {

            if (strpos($line, 'Depot') !== false) {

                $fields = explode(' ', $line);

                if (strcmp($this->p4Depot, $fields[1]) === 0) {

                    $this->p4DepotType = $fields[3];



                    return $this->isStream();