src/DateTime.php
public static function createInterval($interval)
	{
		return	isset(static::$intervals[$interval])
				?	static::$intervals[$interval]
				:	static::$intervals[$interval] = $interval[0] === 'P'
					?	new \DateInterval($interval)
					:	\DateInterval::createFromDateString($interval);
	}
public static function createInterval($interval)
	{
		return	isset(static::$intervals[$interval])
				?	static::$intervals[$interval]
				:	static::$intervals[$interval] = $interval[0] === 'P'
					?	new \DateInterval($interval)
					:	\DateInterval::createFromDateString($interval);
	}
public static function createInterval ( $ interval ) { return isset ( static :: $ intervals [ $ interval ] ) ? static :: $ intervals [ $ interval ] : static :: $ intervals [ $ interval ] = $ interval [ 0 ] === 'P' ? new \ DateInterval ( $ interval ) : \ DateInterval :: createFromDateString ( $ interval ) ; }
Create a DateInterval from ISO 8601 duration string OR relative parts!

This method does a small test on the $interval string for `[0] === 'P'`

@link	http://php.net/manual/en/dateinterval.construct.php
@link	http://php.net/manual/en/dateinterval.createfromdatestring.php
@link	http://php.net/manual/en/datetime.formats.relative.php

This function had a significant 30%~50% performance increase over ->modify()
still had about 20% increase over creating new DateInterval values in a loop

@param	string	$interval	Interval string in relative parts format or ISO 8601 duration

@return DateInterval
Create a DateInterval from ISO 8601 duration string OR relative parts!