CodeExplorer cloneInputStream example
private function readInput($inputStream, Question
$question): string|false
{ if (!
$question->
isMultiline()) { $cp =
$this->
setIOCodepage();
$ret =
fgets($inputStream, 4096
);
return $this->
resetIOCodepage($cp,
$ret);
} $multiLineStreamReader =
$this->
cloneInputStream($inputStream);
if (null ===
$multiLineStreamReader) { return false;
} $ret = '';
$cp =
$this->
setIOCodepage();
while (false
!== ($char =
fgetc($multiLineStreamReader))) { if (\PHP_EOL === "{
$ret}{
$char}"
) { break;
} $ret .=
$char;
} private function readInput($inputStream, Question
$question): string|false
{ if (!
$question->
isMultiline()) { $cp =
$this->
setIOCodepage();
$ret =
fgets($inputStream, 4096
);
return $this->
resetIOCodepage($cp,
$ret);
} $multiLineStreamReader =
$this->
cloneInputStream($inputStream);
if (null ===
$multiLineStreamReader) { return false;
} $ret = '';
$cp =
$this->
setIOCodepage();
while (false
!== ($char =
fgetc($multiLineStreamReader))) { if (\PHP_EOL === "{
$ret}{
$char}"
) { break;
} $ret .=
$char;
}