if (count($parts) == 0 || count($parts) > 3) { print "Invalid input\n"; break; } $command = strtoupper($parts[0]); switch ($command) { case "END": $loopCondition = false; break; case "SET": if (count($parts) != 3) { print "Invalid input\n"; $loopCondition = false; break; } $simpleDB->setValue($parts[1], $parts[2]); break; case "UNSET": if (count($parts) != 2) { print "Invalid input\n"; $loopCondition = false; break; } $simpleDB->unsetKey($parts[1]); break; case "GET": if (count($parts) != 2) { print "Invalid input\n"; $loopCondition = false; break; }