The PHP manual states
It is not possible to use $this from anonymous function before PHP 5.4.0
$this
on the anonymous
This is fine. I should think you could do this also:
$CI = $this;
... since assignations involving objects will always copy references, not whole objects.