I stumbled across this code today
class FILTER extends self
{
protected static function sanitizeHtml($html)
{
static $parser;
if (!isset($parser)) $parser = new HTMLPurifier;
return $parser->purify($html);
}
}
What does this class gain from extendingself
? Im not quite sure if this ruby example is equivalent or even applicable to PHP.
That's not valid code, wherever you saw it. It throws up an error.
Fatal error: Cannot use 'self' as class name as it is reserved
You can see an example here: https://eval.in/775753