3v4l.org

run code in 300+ PHP versions simultaneously
<?phperror_reporting(E_ALL);$address = "141.105.121.87";$port = 10000;$mysock = socket_create(AF_INET,SOCK_STREAM, SOL_TCP);socket_bind($mysock, $address,$port);socket_listen($mysock, 5);echo "Server started, acceptingconnections ...\n";$i = 0;while (true) {$client = socket_accept($mysock);$i++;$c_msg = socket_read($client,65536);$a = 61;$b = 53;$n = $a * $b;$m = ($a - 1) * ($b - 1);$e = 19; // encryption key$k = 1;do {$d = (1 + ($k * $m)) / $e;// decryption key$k++;} while (!is_int($d));// explode cipher message tocipher blocks$c = explode(" ", $c_msg);// decipher the cipher blocks and concat them into plain message$p_msg = "";foreach ($c as $x) {$p_msg .= chr(bcmod(bcpow($x,$d), $n));}//$msg = socket_read($client,2048);echo "\n===== Connection # ". $i . " =====\n";echo "\n Decripting Message........\n";echo "\n-----Chiper Message-----\n";echo "\n $c_msg\n";echo "\n -----Plain Message-----\n";echo "\n$p_msg\n";$decript_file=fopen("C:/xampp/htdocs/RSA/hasil_stego_decript.txt", "w");fwrite($decript_file,$p_msg);fclose($decript_file);echo "\nSending response message to client ...";$t = "Thanks. Your connection # is " . $i . ".";socket_write($client, $t,strlen($t));echo "\nMessage sent\n";echo "\n===== End ofconnection # " . $i . " =====\n";}echo "\nClosing sockets...\n";socket_close($client);socket_close($mysock);?>
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.3 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
<?phperror_reporting(E_ALL);$address = "141.105.121.87";$port = 10000;$mysock = socket_create(AF_INET,SOCK_STREAM, SOL_TCP);socket_bind($mysock, $address,$port);socket_listen($mysock, 5);echo "Server started, acceptingconnections ...\n";$i = 0;while (true) {$client = socket_accept($mysock);$i++;$c_msg = socket_read($client,65536);$a = 61;$b = 53;$n = $a * $b;$m = ($a - 1) * ($b - 1);$e = 19; // encryption key$k = 1;do {$d = (1 + ($k * $m)) / $e;// decryption key$k++;} while (!is_int($d));// explode cipher message tocipher blocks$c = explode(" ", $c_msg);// decipher the cipher blocks and concat them into plain message$p_msg = "";foreach ($c as $x) {$p_msg .= chr(bcmod(bcpow($x,$d), $n));}//$msg = socket_read($client,2048);echo "\n===== Connection # ". $i . " =====\n";echo "\n Decripting Message........\n";echo "\n-----Chiper Message-----\n";echo "\n $c_msg\n";echo "\n -----Plain Message-----\n";echo "\n$p_msg\n";$decript_file=fopen("C:/xampp/htdocs/RSA/hasil_stego_decript.txt", "w");fwrite($decript_file,$p_msg);fclose($decript_file);echo "\nSending response message to client ...";$t = "Thanks. Your connection # is " . $i . ".";socket_write($client, $t,strlen($t));echo "\nMessage sent\n";echo "\n===== End ofconnection # " . $i . " =====\n";}echo "\nClosing sockets...\n";socket_close($client);socket_close($mysock);?>
Output for 8.0.13
Parse error: Unclosed '{' in /in/0SI2h on line 1
Process exited with code 255.
Output for 5.4.0 - 5.4.32, 7.3.32 - 7.3.33, 7.4.33
Parse error: syntax error, unexpected end of file in /in/0SI2h on line 1
Process exited with code 255.

preferences:
140.87 ms | 402 KiB | 172 Q