Open
Description
Description
it won't write text there so you don't know there is a prompt. (fwrite(STDOUT, $text) also i get a timeout (execute timeout) in my own framework which holds some more code. and if i write something to stdin it wont get accepted / continue executing script.
test1.php
<?php
$command = escapeshellcmd(PHP_BINARY) . ' ' . escapeshellarg(__DIR__ . '/test2.php');
var_dump(exec($command, $output));
var_dump($output);
test2.php
<?php
function my_readline($text='') {
fwrite(STDOUT, $text);
return trim(fgets(STDIN));
}
$a = my_readline('test: ');
echo $a;
the fwrite to STDOUT isn't executed if i run test1.php
PHP Version
8.2
Working in php 7.4
Operating System
Debian 11.6