I've done some research on this topic before, and I have another quirky example of code:
PHP Code:
new GuiControl("toastControl") {
this.testFunc = public function() {
echo("Hi there!");
};
}
toastControl.testFunc();
The code works perfectly fine, but it throws a syntax error.