I can do this in PeachPie (PHP Compiler for .NET) which is basically calling .NET standard libraries.
<?php
use \System\Console;
use \System\IO\StreamReader;
use \System\Net\WebRequest;
function main()
{
$uri = $_SERVER['argv'][1];
$http = WebRequest::Create($uri);
$response = $http->GetResponse();
$stream = new StreamReader( $response->GetResponseStream() );
Console::WriteLine( "HTTP Response:\n" . $stream->ReadToEnd() );
}
main();
How to do call Java standard libraries like the one above? I've tried this one.
<?php
function main() {
\System\out::println("Hello World\n");
}
main();
But it gives me.
$ jppm start
-> linux
-> app:run
-> install
Fatal error: Uncaught Error: Class 'System\out' not found in res://index.php on line 4, position 12
Stack Trace:
#0 <internal>() called at [res://index.php:1]
#1 main() called at [res://index.php:7]
#2 {main}
thrown in res://index.php on line 4
I can do this in PeachPie (PHP Compiler for .NET) which is basically calling .NET standard libraries.
How to do call Java standard libraries like the one above? I've tried this one.
But it gives me.