Add TextWriter, IOException, per-VM module data and pre-load imports; Add console module with Console class
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'console';
|
||||
class Program {
|
||||
|
||||
string encode_ip(string $dotquad_ip) {
|
||||
@@ -12,11 +13,11 @@ class Program {
|
||||
|
||||
public void main() {
|
||||
string $localhost = $this->encode_ip('127.0.0.1');
|
||||
print("127.0.0.1 ==> $localhost\n");
|
||||
Console::Print("127.0.0.1 ==> $localhost\n");
|
||||
string $router = $this->encode_ip('192.168.2.1');
|
||||
print("192.168.2.1 ==> $router\n");
|
||||
print("$localhost ==> ", $this->decode_ip($localhost) + PHP_EOL);
|
||||
print("$router ==> ", $this->decode_ip($router) + PHP_EOL);
|
||||
Console::Print("192.168.2.1 ==> $router\n");
|
||||
Console::Print("$localhost ==> " + ($this->decode_ip($localhost) + PHP_EOL));
|
||||
Console::Print("$router ==> " + ($this->decode_ip($router) + PHP_EOL));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user