Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Testing fread() on a TCP server socket --FILE-- <?php for ($i=0; $i<100; $i++) {..

Decoded Output download

--TEST--
Testing fread() on a TCP server socket
--FILE--
<?php

for ($i=0; $i<100; $i++) {
  $port = rand(10000, 65000);
  /* Setup socket server */
  $server = @stream_socket_server("tcp://127.0.0.1:$port");
  if ($server) {
    break;
  }
}

socket_set_timeout($server, 0, 1000);

var_dump(fread($server, 1));

fclose($server);

?>
--EXPECT--
bool(false)

Did this file decode correctly?

Original Code

--TEST--
Testing fread() on a TCP server socket
--FILE--
<?php

for ($i=0; $i<100; $i++) {
  $port = rand(10000, 65000);
  /* Setup socket server */
  $server = @stream_socket_server("tcp://127.0.0.1:$port");
  if ($server) {
    break;
  }
}

socket_set_timeout($server, 0, 1000);

var_dump(fread($server, 1));

fclose($server);

?>
--EXPECT--
bool(false)

Function Calls

rand 1

Variables

$i 0

Stats

MD5 f02f422c830c5d32a67a1efa1c120f89
Eval Count 0
Decode Time 99 ms