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-- ext/sockets - socket_connect - test with empty parameters --CREDITS-- Florian And..

Decoded Output download

--TEST--
ext/sockets - socket_connect - test with empty parameters
--CREDITS--
Florian Anderiasch
[email protected]
--EXTENSIONS--
sockets
--FILE--
<?php

$s_c = socket_create_listen(0);
socket_getsockname($s_c, $addr, $port);

// wrong parameter count
try {
    socket_connect($s_c);
} catch (\ArgumentCountError $e) {
    echo $e->getMessage() . \PHP_EOL;
}
try {
    socket_connect($s_c, '0.0.0.0');
} catch (\ValueError $e) {
    echo $e->getMessage() . \PHP_EOL;
}
$s_w = socket_connect($s_c, '0.0.0.0', $port);

socket_close($s_c);
?>
--EXPECTF--
socket_connect() expects at least 2 arguments, 1 given
socket_connect(): Argument #3 ($port) cannot be null when the socket type is AF_INET

Warning: socket_connect(): unable to connect [%i]: %a in %s on line %d

Did this file decode correctly?

Original Code

--TEST--
ext/sockets - socket_connect - test with empty parameters
--CREDITS--
Florian Anderiasch
[email protected]
--EXTENSIONS--
sockets
--FILE--
<?php

$s_c = socket_create_listen(0);
socket_getsockname($s_c, $addr, $port);

// wrong parameter count
try {
    socket_connect($s_c);
} catch (\ArgumentCountError $e) {
    echo $e->getMessage() . \PHP_EOL;
}
try {
    socket_connect($s_c, '0.0.0.0');
} catch (\ValueError $e) {
    echo $e->getMessage() . \PHP_EOL;
}
$s_w = socket_connect($s_c, '0.0.0.0', $port);

socket_close($s_c);
?>
--EXPECTF--
socket_connect() expects at least 2 arguments, 1 given
socket_connect(): Argument #3 ($port) cannot be null when the socket type is AF_INET

Warning: socket_connect(): unable to connect [%i]: %a in %s on line %d

Function Calls

socket_create_listen 1

Variables

None

Stats

MD5 aa24f2e177185ab7012af0d6ae74f8b7
Eval Count 0
Decode Time 99 ms