????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.191 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/general_functions/ |
Upload File : |
--TEST--
Test getrusage() function : error conditions - incorrect number of args
--SKIPIF--
<?php
if( substr(PHP_OS, 0, 3) == "WIN" )
die("skip.. Do not run on Windows");
?>
--FILE--
<?php
/* Prototype : array getrusage ([ int $who ] )
* Description: Gets the current resource usages
* Source code: ext/standard/microtime.c
* Alias to functions:
*/
/*
* Pass an incorrect number of arguments to getrusage() to test behaviour
*/
echo "*** Testing getrusage() : error conditions ***\n";
echo "\n-- Testing getrusage() function with more than expected no. of arguments --\n";
$extra_arg = 10;
$dat = getrusage(1, $extra_arg);
echo "\n-- Testing getrusage() function with invalid argument - non-numeric STRING--\n";
$string_arg = "foo";
$dat = getrusage($string_arg);
echo "\n-- Testing getrusage() function with invalid argument - ARRAY--\n";
$array_arg = array(1,2,3);
$dat = getrusage($array_arg);
echo "\n-- Testing getrusage() function with invalid argument - OBJECT --\n";
class classA
{
function __toString() {
return "ClassAObject";
}
}
$obj_arg = new classA();
$dat = getrusage($obj_arg);
echo "\n-- Testing getrusage() function with invalid argument - RESOURCE --\n";
$file_handle=fopen(__FILE__, "r");
$dat = getrusage($file_handle);
fclose($file_handle);
?>
===DONE===
--EXPECTF--
*** Testing getrusage() : error conditions ***
-- Testing getrusage() function with more than expected no. of arguments --
Warning: getrusage() expects at most 1 parameter, 2 given in %s on line %d
-- Testing getrusage() function with invalid argument - non-numeric STRING--
Warning: getrusage() expects parameter 1 to be long, string given in %s on line %d
-- Testing getrusage() function with invalid argument - ARRAY--
Warning: getrusage() expects parameter 1 to be long, array given in %s on line %d
-- Testing getrusage() function with invalid argument - OBJECT --
Warning: getrusage() expects parameter 1 to be long, object given in %s on line %d
-- Testing getrusage() function with invalid argument - RESOURCE --
Warning: getrusage() expects parameter 1 to be long, resource given in %s on line %d
===DONE===