JavaScript: Closures; PHP: Declare and Tick