Browse Source

repl: Only lowercase strings

master
Elis Hirwing 3 years ago
parent
commit
5edc7b56c5
Signed by: etu GPG Key ID: D57EFA625C9A925F
  1. 7
      repl.php

7
repl.php

@ -10,12 +10,15 @@ echo PHP_EOL;
echo 'Default item-name is "box".'.PHP_EOL;
echo PHP_EOL;
// Default item name
$defaultItem = 'box';
while (true) {
// Read user input
$line = trim(fgets(STDIN));
$line = trim(strtolower(fgets(STDIN)));
// Handle quit
if (strtolower($line) === 'q') {
if ($line === 'q') {
break;
}
}

Loading…
Cancel
Save