years ago … 2006-04-28 10:29

cool program! note when trying to exec() something:
in the while loop you need to reset exec() returns or you will get all results of all executions (on my windows and or cygwin 🙁
like:

<?php // your class prompt() echo "Enter something or 'exit' to quit\n"; do { $cmdline = new prompt(); $buffer = $cmdline->get('shell command: ');
// init/ reset first!
   $data = null;
   $return = null;
// now start:
   echo "You said: $buffer\n";
   if (!empty($buffer)) {
       $x = exec($buffer, $data, $return);
       print_r($data);
   }
} while ($buffer !== "exit");
echo "Goodbye\n";