Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Get string length
<?php strlen(string $string): int
<?php );
$tagName = $matches[1][0];
$lengthOfTagName = strlen($tagName);
$positionOfFirstCharacterInTagName = $matches[1][1];
return substr_replace(
<?php $directivesPattern = '('
.collect($directives)
->sortBy(fn ($directive) => strlen($directive), descending: true)
->map(fn ($directive) => $directive.'(?![a-zA-Z])')
<?php Validator::make(
[
'foo_length' => strlen($this->foo),
'bar_length' => strlen($this->bar),
],
[ 'foo_length' => 'same:bar_length' ],
<?php Validator::make(
[
'foo_length' => strlen($this->foo),
'bar_length' => strlen($this->bar),
],
[ 'foo_length' => 'same:bar_length' ],
[ 'same' => 'Lengths must be the same' ]
<?php }
if ($fullName->startsWith($namespace)) {
return (string) $fullName->substr(strlen($namespace) + 1);
}
return (string) $fullName;
<?php $error = is_callable($validate) ? $validate($result) : $this->validatePrompt($result, $validate);
if (is_string($error) && strlen($error) > 0) {
$this->components->error($error);
if ($this->laravel->runningUnitTests()) {
<?php $string = $messages;
}
return strlen($string) - strlen(rtrim($string, PHP_EOL));
}
<?php $prefix = $connection->getTablePrefix();
return str_starts_with($table, $prefix)
? substr($table, strlen($prefix))
: $table;
}
}
<?php foreach ($this->eagerLoad as $name => $constraints) {
if ($this->isNestedUnder($relation, $name)) {
$nested[substr($name, strlen($relation.'.'))] = $constraints;
}
}
<?php $isStringLiteral = false;
for ($i = 0; $i < strlen($sql); $i++) {
$char = $sql[$i];
$nextChar = $sql[$i + 1] ?? null;
<?php $migrations = collect(preg_split("/\r\n|\n|\r/", $process->getOutput()))->filter(function ($line) {
return stripos($line, 'sqlite_sequence') === false &&
strlen($line) > 0;
})->all();
$this->files->put($path, implode(PHP_EOL, $migrations).PHP_EOL);
<?php $migrations = collect(preg_split("/\r\n|\n|\r/", $process->getOutput()))->filter(function ($line) {
return preg_match('/^\s*(--|INSERT\s)/iu', $line) === 1 &&
strlen($line) > 0;
})->all();
$this->files->append($path, implode(PHP_EOL, $migrations).PHP_EOL);
<?php return false;
}
return strlen(base64_decode($payload['iv'], true)) === openssl_cipher_iv_length(strtolower($this->cipher));
}
<?php protected function ensureTagIsValid($tag)
{
if (self::$supportedCiphers[strtolower($this->cipher)]['aead'] && strlen($tag) !== 16) {
throw new DecryptException('Could not decrypt the data.');
}
<?php $replacements = [
str_replace('/', '\\', dirname(str_replace('\\', '/', $alias))),
class_basename($alias),
substr($alias, strlen(static::$facadeNamespace)),
];
return str_replace(