PHP-CLI如何写入用户输入?

I want to get predefined user input.

echo 'Enter value: ';
# here write some 'default value'
$value = fgets(STDIN);

So then user get prompt, he can edit input.

Enter value: default value # Here we can backslash and write new one.

How to achieve?

That is not the default/commen way of handling this stuff in shell scripts. In almost any programm you'll find something like this:

Enter your value: [Default Value]

$default = "Default Value";
echo "Enter your value: [", $default, "]";
$result = fgets(STDIN);
if (empty($result)) $result = $default;

Where as the default value gets set when the STDIN of that get was empty.

I'm pretty surr that the thing you want to achive isn't possible at all.