In JavaScript, you can define anonymous functions that are executed immediately:
(function () { /* do something */ })()
Can you do somethin
For PHP7: see Yasuo Ohgaki's answer: (function() {echo 'Hi';})();
(function() {echo 'Hi';})();
For previous versions: the only way to execute them immediately I can think of is
call_user_func(function() { echo 'executed'; });