class SimpleClass
{
public function __invoke()
{
return $this;
}
public function stdout($string)
{
echo $string;
return $this;
}
}
class SimpleClass
{
public function __invoke(string $string = PHP_EOL): self
{
echo $string;
return $this;
}
}
$string = 'qwe';
$resultString = '';
$stringLength = mb_strlen($string);
if ($stringLength < 2) {
$resultString = mb_strtoupper($string);
} else {
$firstCharacter = mb_substr($string, 0, 1);
$middle = mb_substr($string, 1, $stringLength - 2);
$lastCharacter = mb_substr($string, $stringLength - 1, 1);
$resultString = mb_strtoupper($firstCharacter).$middle.mb_strtoupper($lastCharacter);
}
$hello = 'echo 123';
$text = shell_exec("php -r '{$hello}'");
echo $text;