Cannot re-assign $this

Description

It is never possible to assign a new value to the pseudo-variable $this, inside a class or outside. In fact, it is also never allowed to unset it either. In short, it is possible to read $this, and nothing more.

Example

<?php

unset($this);

?>

Solutions

  • Remove this call to unset.