Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Binary safe case-insensitive string comparison
<?php strcasecmp(string $string1, string $string2): int
<?php if (($options & SORT_NATURAL) === SORT_NATURAL) {
$result = strnatcasecmp($values[0], $values[1]);
} else {
$result = strcasecmp($values[0], $values[1]);
}
} else {
$result = match ($options) {
<?php public function prefetch()
{
return strcasecmp($this->server->get('HTTP_X_MOZ') ?? '', 'prefetch') === 0 ||
strcasecmp($this->headers->get('Purpose') ?? '', 'prefetch') === 0 ||
strcasecmp($this->headers->get('Sec-Purpose') ?? '', 'prefetch') === 0;
}
<?php public function prefetch()
{
return strcasecmp($this->server->get('HTTP_X_MOZ') ?? '', 'prefetch') === 0 ||
strcasecmp($this->headers->get('Purpose') ?? '', 'prefetch') === 0 ||
strcasecmp($this->headers->get('Sec-Purpose') ?? '', 'prefetch') === 0;
}
<?php {
return strcasecmp($this->server->get('HTTP_X_MOZ') ?? '', 'prefetch') === 0 ||
strcasecmp($this->headers->get('Purpose') ?? '', 'prefetch') === 0 ||
strcasecmp($this->headers->get('Sec-Purpose') ?? '', 'prefetch') === 0;
}
<?php array_filter(
$this->schemaManager->listSequences(),
static function (Sequence $sequence) use ($sequenceName): bool {
return strcasecmp($sequence->getName(), $sequenceName) === 0;
}
)
)[0] ?? null;
<?php $publicKey = $connection->getServerPublicHostKey() ?: 'no-public-key';
$fingerprint = $this->getFingerprintFromPublicKey($publicKey);
if (0 !== strcasecmp($this->hostFingerprint, $fingerprint)) {
throw UnableToEstablishAuthenticityOfHost::becauseTheAuthenticityCantBeEstablished($this->host);
}
}
<?php $publicKey = $connection->getServerPublicHostKey() ?: 'no-public-key';
$fingerprint = $this->getFingerprintFromPublicKey($publicKey);
if (0 !== strcasecmp($this->hostFingerprint, $fingerprint)) {
throw UnableToEstablishAuthenticityOfHost::becauseTheAuthenticityCantBeEstablished($this->host);
}
}
<?php public function endsWith($haystack, $needle)
{
return strcasecmp(substr($haystack, strlen($haystack) - strlen($needle)), $needle) === 0;
}
<?php foreach (array_keys(BasePackage::$supportedLinkTypes) as $linkType) {
if ($this->validateArray($linkType) && isset($this->config[$linkType])) {
foreach ($this->config[$linkType] as $package => $constraint) {
if (0 === strcasecmp($package, $this->config['name'])) {
$this->errors[] = $linkType.'.'.$package.' : a package cannot set a '.$linkType.' on itself';
unset($this->config[$linkType][$package]);
continue;
<?php {
if (Str::contains($value, '.')) {
$reference = Str::before($value, '.');
if (strcasecmp($model, $reference) === 0) {
return Str::after($value, '.');
}
}