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 foreach (array_reverse($dirs) as $dir) {
$bestDirFound = $dir;
if (PHP_VERSION_ID >= 80000 && false !== strpos($dir, 'phpunit-9')) {
break;
}
if (PHP_VERSION_ID < 80000 && false !== strpos($dir, 'phpunit-8')) {
<?php if (PHP_VERSION_ID >= 80000 && false !== strpos($dir, 'phpunit-9')) {
break;
}
if (PHP_VERSION_ID < 80000 && false !== strpos($dir, 'phpunit-8')) {
break;
}
}
<?php $pattern = Preg::replace('{^(([^.+*?\[^\]$(){}=!<>|:\\\\#-]+|\\\\[.+*?\[^\]$(){}=!<>|:#-])*).*}', '$1', $pattern);
if (0 !== strpos($pattern, $dirMatch) && 0 !== strpos($dirMatch, $pattern)) {
unset($excluded[$index]);
}
}
<?php $path = $filesystem->normalizePath($path);
$baseDir = '';
if (strpos($path.'/', $vendorPath.'/') === 0) {
$path = substr($path, strlen($vendorPath));
$baseDir = '$vendorDir';
<?php }
}
if (strpos($path, '.phar') !== false) {
$baseDir = "'phar://' . " . $baseDir;
}
<?php }
foreach ((array) $loader as $prop => $value) {
if ($value && 0 === strpos($prop, $prefix)) {
$maps[substr($prop, $prefixLen)] = $value;
}
}
<?php if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
<?php if (is_string($path)) {
if (is_file($path)) {
$path = array(new \SplFileInfo($path));
} elseif (is_dir($path) || strpos($path, '*') !== false) {
$path = Finder::create()->files()->followLinks()->name('/\.(php|inc|hh)$/')->in($path);
} else {
throw new \RuntimeException(
<?php foreach ($classes as $class) {
if (null === $autoloadType && null !== $namespace && '' !== $namespace && 0 !== strpos($class, $namespace)) {
continue;
}
<?php foreach ($classes as $class) {
if ('' !== $baseNamespace && 0 !== strpos($class, $baseNamespace)) {
continue;
}
<?php $value = $data['repositories'][$matches[1]];
}
} elseif (strpos($settingKey, '.')) {
$bits = explode('.', $settingKey);
if ($bits[0] === 'extra') {
$data = $rawData;
<?php ),
);
if ($input->getOption('global') && (isset($uniqueProps[$settingKey]) || isset($multiProps[$settingKey]) || strpos($settingKey, 'extra.') === 0)) {
throw new \InvalidArgumentException('The ' . $settingKey . ' property can not be set in the global config.json file. Use `composer global config` to apply changes to the global composer.json');
}
if ($input->getOption('unset') && (isset($uniqueProps[$settingKey]) || isset($multiProps[$settingKey]))) {
<?php $io->write('Checking disk free space: ', false);
$this->outputResult($this->checkDiskSpace($config));
if (strpos(__FILE__, 'phar:') === 0) {
$io->write('Checking pubkeys: ', false);
$this->outputResult($this->checkPubKeys($config));
<?php $platformRepo = new PlatformRepository(array(), $platformOverrides);
$phpPkg = $platformRepo->findPackage('php', '*');
$phpVersion = $phpPkg->getPrettyVersion();
if ($phpPkg instanceof CompletePackageInterface && false !== strpos($phpPkg->getDescription(), 'overridden')) {
$phpVersion .= ' - ' . $phpPkg->getDescription();
}
<?php $result = array($result);
}
foreach ($result as $message) {
if (false !== strpos($message, '<error>')) {
$hadError = true;
} elseif (false !== strpos($message, '<warning>')) {
$hadWarning = true;