protected function createIterator($subject)
	{
		if($subject === NULL)
		{
			return new \ArrayIterator([]);
		}
		
		if(is_array($subject))
		{
			return new \ArrayIterator($subject);
		}
		
		if($subject instanceof \Generator)
		{
			return $subject;
		}
		
		if($subject instanceof \Iterator)
		{
			$subject->rewind();
			
			return $subject;
		}
		
		if($subject instanceof \IteratorAggregate)
		{
			return $subject->getIterator();
		}
		
		if($subject instanceof \Traversable)
		{
			return new \IteratorIterator($subject);
		}
		
		if(is_object($subject))
		{
			return new \ArrayIterator(get_object_vars($subject));
		}
		
		throw new \InvalidArgumentException(sprintf('Unable to create an iterator from %s', gettype($subject)));
	}
protected function createIterator($subject)
	{
		if($subject === NULL)
		{
			return new \ArrayIterator([]);
		}
		
		if(is_array($subject))
		{
			return new \ArrayIterator($subject);
		}
		
		if($subject instanceof \Generator)
		{
			return $subject;
		}
		
		if($subject instanceof \Iterator)
		{
			$subject->rewind();
			
			return $subject;
		}
		
		if($subject instanceof \IteratorAggregate)
		{
			return $subject->getIterator();
		}
		
		if($subject instanceof \Traversable)
		{
			return new \IteratorIterator($subject);
		}
		
		if(is_object($subject))
		{
			return new \ArrayIterator(get_object_vars($subject));
		}
		
		throw new \InvalidArgumentException(sprintf('Unable to create an iterator from %s', gettype($subject)));
	}
protected function createIterator ( $ subject ) { if ( $ subject === NULL ) { return new \ ArrayIterator ( [ ] ) ; } if ( is_array ( $ subject ) ) { return new \ ArrayIterator ( $ subject ) ; } if ( $ subject instanceof \ Generator ) { return $ subject ; } if ( $ subject instanceof \ Iterator ) { $ subject -> rewind ( ) ; return $ subject ; } if ( $ subject instanceof \ IteratorAggregate ) { return $ subject -> getIterator ( ) ; } if ( $ subject instanceof \ Traversable ) { return new \ IteratorIterator ( $ subject ) ; } if ( is_object ( $ subject ) ) { return new \ ArrayIterator ( get_object_vars ( $ subject ) ) ; } throw new \ InvalidArgumentException ( sprintf ( 'Unable to create an iterator from %s' , gettype ( $ subject ) ) ) ; }
Create an iterator from the given input, will create an ArrayIterator backed by an empty array
when the input is NULL.

This method will rewind any Iterator given as input (with the exception of a Generator which cannot be
reset to it's initial position).

@param mixed $subject
@return \Iterator

@throws \InvalidArgumentException When no iterator could be created for a non-object input.
Create an iterator from the given input will create an ArrayIterator backed by an empty array when the input is NULL .