Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find the position of the first occurrence of a substring in a string
<?php strpos(string $haystack, string $needle, int $offset = 0): int|false
<?php if (strpos($layer, 'php-8') === false) {
exec("docker run --rm -v \${PWD}/helpers:/var/task/ --entrypoint /var/task/extensions-test.sh $layer", $output, $exitCode);
if ($exitCode !== 0) {
throw new Exception(implode(PHP_EOL, $output), $exitCode);
<?php $animation->tick('Starting the dashboard');
usleep(100 * 1000);
$serverOutput = $process->getOutput() . $process->getErrorOutput();
$hasStarted = (strpos($serverOutput, 'Development Server') !== false);
} while ($process->isRunning() && ! $hasStarted);
$animation->clear();
if (! $process->isRunning()) {
<?php private static function parseKeyAndInsertValueInArray(array &$array, string $key, $value): void
{
if (strpos($key, '[') === false) {
$array[$key] = $value;
return;
<?php curl_setopt($this->curlHandleNext, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($this->curlHandleNext, CURLOPT_FAILONERROR, true);
$phpVersion = substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.', 2));
curl_setopt($this->curlHandleNext, CURLOPT_USERAGENT, "bref/{$this->layer}/$phpVersion");
}
<?php $api->setTimeout(0);
$api->start();
$api->waitUntil(function ($type, $output) {
return strpos($output, 'Running on http://127.0.0.1:3000/') !== false;
});
try {
<?php $logLines = array_filter($logLines, function (string $line): bool {
$line = trim($line);
return $line !== ''
&& (strpos($line, 'START') !== 0)
&& (strpos($line, 'END') !== 0)
&& (strpos($line, 'REPORT') !== 0);
});
<?php $line = trim($line);
return $line !== ''
&& (strpos($line, 'START') !== 0)
&& (strpos($line, 'END') !== 0)
&& (strpos($line, 'REPORT') !== 0);
});
$this->assertCount(1, $logLines);
<?php return $line !== ''
&& (strpos($line, 'START') !== 0)
&& (strpos($line, 'END') !== 0)
&& (strpos($line, 'REPORT') !== 0);
});
$this->assertCount(1, $logLines);
$logLine = reset($logLines);
<?php $api->setTimeout(0.);
$api->start();
$api->waitUntil(function ($type, $output) {
return strpos($output, 'Running on http://127.0.0.1:3000/') !== false;
});
try {