constants names should be quoted when checking if defined
fix use of $this in a closure breaking all things