joomla/joomla-cms — pull request #3199 by chalet16 (2014-02-27 19:04:38+00:00)
Title: Make JEventDispatcher compatible with HHVM

According to HHVM inconsistencies guildline, "Under Zend PHP, foreach by value will modify the array's internal cursor under certain circumstances. Under HipHop VM, foreach by value will never modify the array's internal cursor.

Moving end() from above key() function to below it also make the code easier to understand as the behavior of foreach with array cursor is complicated to understand.