Automated merge with http://hg.ellislab.com/CodeIgniterNoPhp4/
diff --git a/system/core/Common.php b/system/core/Common.php
index 56fe713..6a3d5ac 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -163,29 +163,10 @@
 		// Keep track of what we just loaded
 		is_loaded($class);
 
-		$_classes[$class] =& instantiate_class(new $name());
+		$_classes[$class] = new $name();
 		return $_classes[$class];
 	}
 
-// ------------------------------------------------------------------------
-
-/**
- * Instantiate Class
- *
- * Returns a new class object by reference, used by load_class() and the DB class.
- * Required to retain PHP 4 compatibility and also not make PHP 5.3 cry.
- *
- * Use: $obj =& instantiate_class(new Foo());
- *
- * @access	public
- * @param	object
- * @return	object
- */
-	function &instantiate_class(&$class_object)
-	{
-		return $class_object;
-	}
-
 // --------------------------------------------------------------------
 
 /**
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 6991764..b64a6e6 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -267,7 +267,7 @@
 		require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility'.EXT);
 		$class = 'CI_DB_'.$CI->db->dbdriver.'_utility';
 
-		$CI->dbutil =& instantiate_class(new $class());
+		$CI->dbutil = new $class();
 	}
 
 	// --------------------------------------------------------------------
@@ -703,9 +703,7 @@
 		}
 		else
 		{
-			// PHP 4 requires that we use a global
-			global $OUT;
-			$OUT->append_output(ob_get_contents());
+			$_ci_CI->append_output(ob_get_contents());
 			@ob_end_clean();
 		}
 	}
diff --git a/system/database/DB.php b/system/database/DB.php
index b51995b..60a67e8 100644
--- a/system/database/DB.php
+++ b/system/database/DB.php
@@ -130,7 +130,7 @@
 
 	// Instantiate the DB adapter
 	$driver = 'CI_DB_'.$params['dbdriver'].'_driver';
-	$DB =& instantiate_class(new $driver($params));
+	$DB = new $driver($params);
 
 	if ($DB->autoinit == TRUE)
 	{
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index c9c8ced..dec5f34 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -712,14 +712,6 @@
 	 */
 	function image_rotate_gd()
 	{
-		// Is Image Rotation Supported?
-		// this function is only supported as of PHP 4.3
-		if ( ! function_exists('imagerotate'))
-		{
-			$this->set_error('imglib_rotate_unsupported');
-			return FALSE;
-		}
-
 		//  Create the image handle
 		if ( ! ($src_img = $this->image_create_gd()))
 		{
@@ -1215,11 +1207,6 @@
 							return FALSE;
 						}
 
-						if (phpversion() == '4.4.1')
-						{
-							@touch($this->full_dst_path); // PHP 4.4.1 bug #35060 - workaround
-						}
-
 						if ( ! @imagejpeg($resource, $this->full_dst_path, $this->quality))
 						{
 							$this->set_error('imglib_save_failed');