Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find highest value
<?php max(mixed $value, mixed ...$values): mixed
<?php $num = 2;
$lineNum = $info['line'];
$startLine = max($lineNum - $num, 1);
$endLine = $lineNum + $num;
$code = file_get_contents($info['file']);
<?php public function previousPage($pageName = 'page')
{
$this->setPage(max(($this->paginators[$pageName] ?? 1) - 1, 1), $pageName);
}
public function nextPage($pageName = 'page')
<?php {
$key = $this->cleanRateLimiterKey($key);
return max(0, $this->cache->get($key.':timer') - $this->currentTime());
}
<?php public function put($key, $value, $seconds)
{
return (bool) $this->connection()->setex(
$this->prefix.$key, (int) max(1, $seconds), $this->serialize($value)
);
}
<?php foreach ($serializedValues as $key => $value) {
$result = (bool) $this->connection()->setex(
$key, (int) max(1, $seconds), $value
);
$manyResult = is_null($manyResult) ? $result : $result && $manyResult;
<?php $lua = "return redis.call('exists',KEYS[1])<1 and redis.call('setex',KEYS[1],ARGV[2],ARGV[1])";
return (bool) $this->connection()->eval(
$lua, 1, $this->prefix.$key, $this->serialize($value), (int) max(1, $seconds)
);
}
<?php public function forPage($page, $perPage)
{
$offset = max(0, ($page - 1) * $perPage);
return $this->slice($offset, $perPage);
}
<?php $hasMutex = $event->mutex->exists($event) ? 'Has Mutex › ' : '';
$dots = str_repeat('.', max(
$terminalWidth - mb_strlen($expression.$repeatExpression.$command.$nextDueDateLabel.$nextDueDate.$hasMutex) - 8, 0
));
$command = preg_replace("#(php artisan [\w\-:]+) (.+)#", '$1 <fg=yellow;options=bold>$2</>', $command);
<?php ]);
$this->renderView('line', array_merge(static::$styles[$style], [
'marginTop' => $this->output instanceof NewLineAware ? max(0, 2 - $this->output->newLinesWritten()) : 1,
'content' => $string,
]), $verbosity);
}
<?php $runTimeWidth = mb_strlen($runTime);
$width = min(terminal()->width(), 150);
$dots = max($width - $descriptionWidth - $runTimeWidth - 10, 0);
$this->output->write(str_repeat('<fg=gray>.</>', $dots), false, $verbosity);
$this->output->write("<fg=gray>$runTime</>", false, $verbosity);
<?php $this->getPdo()->commit();
}
$this->transactions = max(0, $this->transactions - 1);
} catch (Throwable $e) {
$this->handleCommitTransactionException(
$e, $currentAttempt, $attempts
<?php [$levelBeingCommitted, $this->transactions] = [
$this->transactions,
max(0, $this->transactions - 1),
];
$this->transactionsManager?->commit(
<?php protected function handleCommitTransactionException(Throwable $e, $currentAttempt, $maxAttempts)
{
$this->transactions = max(0, $this->transactions - 1);
if ($this->causedByConcurrencyError($e) && $currentAttempt < $maxAttempts) {
return;
<?php {
$property = $this->unions ? 'unionOffset' : 'offset';
$this->$property = max(0, (int) $value);
return $this;
}
<?php return $channels->map(function ($channel, $channelName) use ($maxChannelName, $terminalWidth) {
$resolver = $channel instanceof Closure ? 'Closure' : $channel;
$spaces = str_repeat(' ', max($maxChannelName + 6 - mb_strlen($channelName), 0));
$dots = str_repeat('.', max(
$terminalWidth - mb_strlen($channelName.$spaces.$resolver) - 6, 0