Some micro-optimizations
diff --git a/system/core/Input.php b/system/core/Input.php
index c6063a2..142e2b4 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -356,11 +356,7 @@
 					// Some proxies typically list the whole chain of IP
 					// addresses through which the client has reached us.
 					// e.g. client_ip, proxy_ip1, proxy_ip2, etc.
-					if (strpos($spoof, ',') !== FALSE)
-					{
-						$spoof = explode(',', $spoof, 2);
-						$spoof = $spoof[0];
-					}
+					sscanf($spoof, '%[^,]', $spoof);
 
 					if ( ! $this->valid_ip($spoof))
 					{
@@ -430,7 +426,7 @@
 					}
 
 					// Split the netmask length off the network address
-					list($netaddr, $masklen) = explode('/', $proxy_ips[$i], 2);
+					sscanf($proxy_ips[$i], '%[^/]/%d', $netaddr, $masklen);
 
 					// Again, an IPv6 address is most likely in a compressed form
 					if ($separator === ':')
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php
index 5f05f07..0fa400d 100644
--- a/system/helpers/date_helper.php
+++ b/system/helpers/date_helper.php
@@ -450,20 +450,13 @@
 			return FALSE;
 		}
 
-		$split = explode(' ', $datestr);
+		sscanf($datestr, '%d-%d-%d %s %s', $year, $month, $day, $time, $ampm);
+		sscanf($time, '%d:%d:%d', $hour, $min, $sec);
+		isset($sec) OR $sec = 0;
 
-		list($year, $month, $day) = explode('-', $split[0]);
-
-		$ex = explode(':', $split['1']);
-
-		$hour	= (int) $ex[0];
-		$min	= (int) $ex[1];
-		$sec	= ( ! empty($ex[2]) && preg_match('/[0-9]{1,2}/', $ex[2]))
-				? (int) $ex[2] : 0;
-
-		if (isset($split[2]))
+		if (isset($ampm))
 		{
-			$ampm = strtolower($split[2]);
+			$ampm = strtolower($ampm);
 
 			if ($ampm[0] === 'p' && $hour < 12)
 			{
diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php
index bb13c33..96e65f1 100755
--- a/system/libraries/Session/Session.php
+++ b/system/libraries/Session/Session.php
@@ -528,7 +528,7 @@
 		foreach ($this->all_userdata() as $name => $value)
 		{
 			$parts = explode(self::FLASHDATA_NEW, $name);
-			if (is_array($parts) && count($parts) === 2)
+			if (count($parts) === 2)
 			{
 				$new_name = self::FLASHDATA_KEY.self::FLASHDATA_OLD.$parts[1];
 				$this->set_userdata($new_name, $value);
diff --git a/tests/codeigniter/database/DB_driver_test.php b/tests/codeigniter/database/DB_driver_test.php
index 9e16e29..1f48ca9 100644
--- a/tests/codeigniter/database/DB_driver_test.php
+++ b/tests/codeigniter/database/DB_driver_test.php
@@ -5,7 +5,7 @@
 	public function test_initialize()
 	{
 		$config = Mock_Database_DB::config(DB_DRIVER);
-		$driver_name = current(explode('/', DB_DRIVER));
+		sscanf(DB_DRIVER, '%[^/]/', $driver_name);
 		$driver = $this->$driver_name($config[DB_DRIVER]);
 
 		$this->assertTrue($driver->initialize());
diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php
index 5b202f1..4fc9c63 100644
--- a/tests/mocks/autoloader.php
+++ b/tests/mocks/autoloader.php
@@ -38,13 +38,11 @@
 
 	if (strpos($class, 'Mock_') === 0)
 	{
-		$class = str_replace(array('Mock_', '_'), array('', DIRECTORY_SEPARATOR), $class);
-		$class = strtolower($class);
+		$class = strtolower(str_replace(array('Mock_', '_'), array('', DIRECTORY_SEPARATOR), $class));
 	}
 	elseif (strpos($class, 'CI_') === 0)
 	{
-		$fragments = explode('_', $class, 2);
-		$subclass = next($fragments);
+		$subclass = substr($class, 3);
 
 		if (in_array($subclass, $ci_core))
 		{
@@ -88,7 +86,7 @@
 		}
 	}
 
-	$file = (isset($file)) ? $file : $dir.$class.'.php';
+	$file = isset($file) ? $file : $dir.$class.'.php';
 
 	if ( ! file_exists($file))
 	{