Replace is_null() with === / !== NULL
Exact same behavior, but faster. I also think it's more readable.
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 4d95d62..1ad07f1 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -205,7 +205,7 @@
return;
}
- if ( ! is_null($params) && ! is_array($params))
+ if ($params !== NULL && ! is_array($params))
{
$params = NULL;
}
@@ -975,7 +975,7 @@
// Before we deem this to be a duplicate request, let's see
// if a custom object name is being supplied. If so, we'll
// return a new instance of the object
- if ( ! is_null($object_name))
+ if ($object_name !== NULL)
{
$CI =& get_instance();
if ( ! isset($CI->$object_name))
@@ -1014,7 +1014,7 @@
// Before we deem this to be a duplicate request, let's see
// if a custom object name is being supplied. If so, we'll
// return a new instance of the object
- if ( ! is_null($object_name))
+ if ($object_name !== NULL)
{
$CI =& get_instance();
if ( ! isset($CI->$object_name))
@@ -1144,7 +1144,7 @@
// Was a custom class name supplied? If so we'll use it
$class = strtolower($class);
- if (is_null($object_name))
+ if ($object_name === NULL)
{
$classvar = isset($this->_ci_varmap[$class]) ? $this->_ci_varmap[$class] : $class;
}