braces on their own line to match coding guidelines
https://area51.phpbb.com/docs/31x/coding-guidelines.html
PHP 5.3 array() syntax instead of PHP 5.4 [] syntax
anonymous function shouldn't use 'global' to access parent scope