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

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Concurrent\Network; use Concurrent\Timer; error_reporting(-1); if (DIR..

Decoded Output download

<?php

namespace Concurrent\Network;

use Concurrent\Timer;

error_reporting(-1);

if (DIRECTORY_SEPARATOR == '\\') {
    $file = 'async-test.sock';
} else {
    $file = sprintf('%s/async-test.sock', sys_get_temp_dir());

    if (file_exists($file)) {
        unlink($file);
    }
}

$server = PipeServer::listen($file);
$sock = $server->accept();

try {
    $timer = new Timer(2);
    $len = 0;

    while (null !== ($chunk = $sock->read())) {
        $timer->awaitTimeout();
        $len += strlen($chunk);

        if ($chunk !== str_repeat('A', strlen($chunk))) {
            throw new \Error('Corrupted data received');
        }
    }

    var_dump($len);
} catch (\Throwable $e) {
    echo $e, "\n\n";
} finally {
    $sock->close();
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Concurrent\Network;

use Concurrent\Timer;

error_reporting(-1);

if (DIRECTORY_SEPARATOR == '\\') {
    $file = 'async-test.sock';
} else {
    $file = sprintf('%s/async-test.sock', sys_get_temp_dir());

    if (file_exists($file)) {
        unlink($file);
    }
}

$server = PipeServer::listen($file);
$sock = $server->accept();

try {
    $timer = new Timer(2);
    $len = 0;

    while (null !== ($chunk = $sock->read())) {
        $timer->awaitTimeout();
        $len += strlen($chunk);

        if ($chunk !== str_repeat('A', strlen($chunk))) {
            throw new \Error('Corrupted data received');
        }
    }

    var_dump($len);
} catch (\Throwable $e) {
    echo $e, "\n\n";
} finally {
    $sock->close();
}

Function Calls

None

Variables

None

Stats

MD5 53a6127460ec3a1f256c99b77e22b203
Eval Count 0
Decode Time 138 ms