PHP 8.5.0 Alpha 4 available for testing

Voting

: seven plus one?
(Example: nine)

The Note You're Voting On

flobee
19 years ago
re to: ds at NOSPAM dot undesigned dot org dot za

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 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";

<< Back to user notes page

To Top