As I said untested :P I actually didn't do any modification, I just copy and pasted from above and when I was done fighting with GitHub JS and Safari I forgot to actually change the code..

Lets try again:

```php

if (empty(static::$instance))
{
	if (class_exists($name) && (is_subclass_of($name, 'JApplicationBase')))
	{
		self::$instance = new $name;
	}
	else
	{
		self::$instance = new static;
	}
}
```