Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Binary safe string comparison
<?php strcmp(string $string1, string $string2): int
<?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();
<?php             }



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

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

            });



            $this->assertSame($expectInstalled, $actualInstalled);