{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/hhvm/issues/5862","labels_url":"https://api.github.com/repos/facebook/hhvm/issues/5862/labels{/name}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/5862/comments","events_url":"https://api.github.com/repos/facebook/hhvm/issues/5862/events","html_url":"https://github.com/facebook/hhvm/issues/5862","id":99407263,"number":5862,"title":"Array output in incorrect order on Magento Currencies ","user":{"login":"rossmc","id":2452991,"avatar_url":"https://avatars.githubusercontent.com/u/2452991?v=3","gravatar_id":"","url":"https://api.github.com/users/rossmc","html_url":"https://github.com/rossmc","followers_url":"https://api.github.com/users/rossmc/followers","following_url":"https://api.github.com/users/rossmc/following{/other_user}","gists_url":"https://api.github.com/users/rossmc/gists{/gist_id}","starred_url":"https://api.github.com/users/rossmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossmc/subscriptions","organizations_url":"https://api.github.com/users/rossmc/orgs","repos_url":"https://api.github.com/users/rossmc/repos","events_url":"https://api.github.com/users/rossmc/events{/privacy}","received_events_url":"https://api.github.com/users/rossmc/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-08-06T10:42:28Z","updated_at":"2015-08-06T12:17:27Z","closed_at":"2015-08-06T12:17:27Z","body":"(Following on from a comment [issues3202#issuecomment-128024603](https://github.com/facebook/hhvm/issues/3202#issuecomment-128024603))\r\n\r\n#### The Issue\r\nOn Magento there is an issue with how the currency rates table is displayed.  It is outputting the currencies in the wrong order.\r\n\r\nWith HHVM on, the base currency input field is in the second column. i.e. the Euro rate is 1.0000, it should be under the Euro column not the GBP column.\r\n![Curency Rates with HHVM on](http://i.stack.imgur.com/R2vmb.jpg)\r\nWhen HHVM is off it is displayed correctly.\r\n![Curency Rates with HHVM off](http://i.stack.imgur.com/imDET.jpg)\r\n\r\n#### My Environment\r\nThis issue is occuring on our Magento store (v1.9.2) and a fresh Magento instalation(v1.9.1.1).   Our PHP Version is 5.6.99-hhvm and HHVM Version 3.7.2.\r\n\r\nAlso I have `hhvm.enable_zend_sorting = 1` & `hhvm.enable_obj_destruct_call = 1` set in my */etc/hhvm/php.ini* and */etc/hhvm/server.ini* files.\r\n\r\n#### To Reproduce\r\nTo replicate the issue on Magento you need to have three [currency rates set](http://merch.docs.magento.com/ce/user_guide/Magento_Community_Edition_User_Guide.html#configuration/currency-setup.html), one base currency and two allowed currencies, then you will see the issue when you got to *System > Manage Currency Rates* from the Magento admin panel.\r\n\r\n#### My Debugging\r\nI'm trying to find the unsupported PHP code but my debugging skills are not there yet, so far I've found that in: \r\n*app/design/adminhtml/default/default/template/system/currency/rate/matrix.phtml*\r\n`$_oldRates = $this->getOldRates();` is getting an array in the wrong order with HHVM turned on.  With xDebug in PHPStorm it is showing the result as:\r\n```\r\n$_oldRate = {array}[1]\r\n  EUR = {array}[3]\r\n    USD = \"1.0861\"\r\n    EUR = \"1.0000\"\r\n    GBP = \"0.6969\"\r\n```\r\nBut with HHVM off the result is correctly:\r\n```\r\n$_oldRate = {array}[1]\r\n  EUR = {array}[3]\r\n    EUR = \"1.0000\"\r\n    GBP = \"0.6969\"\r\n    USD = \"1.0861\"\r\n```\r\nI'm not sure were the unsupported PHP code is though, I thought it might be in *Mage_Adminhtml_Block_System_Currency_Rate_Matrix::prepareRates* but that function returns the array in the correct order. \r\n\r\nxDebug  also brought me into *Varien_Object::getData* were I found that `$this->_data` was also returning the `EUR` array in the wrong order but I'm not sure were to look next.\r\n\r\nAny advice on how I can find the unsupported piece of PHP code would be appreciated.\r\n\r\nIn  [issues 3202](https://github.com/facebook/hhvm/issues/3202#issuecomment-128024603) @danslo commented that it may have something to do with [this inconsistency](https://github.com/facebook/hhvm/blob/4498e2b25bc17ace502b4c86c551dbab25f284bf/hphp/doc/inconsistencies#L15)"},"comment":{"url":"https://api.github.com/repos/facebook/hhvm/issues/comments/128345265","html_url":"https://github.com/facebook/hhvm/issues/5862#issuecomment-128345265","issue_url":"https://api.github.com/repos/facebook/hhvm/issues/5862","id":128345265,"user":{"login":"rossmc","id":2452991,"avatar_url":"https://avatars.githubusercontent.com/u/2452991?v=3","gravatar_id":"","url":"https://api.github.com/users/rossmc","html_url":"https://github.com/rossmc","followers_url":"https://api.github.com/users/rossmc/followers","following_url":"https://api.github.com/users/rossmc/following{/other_user}","gists_url":"https://api.github.com/users/rossmc/gists{/gist_id}","starred_url":"https://api.github.com/users/rossmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossmc/subscriptions","organizations_url":"https://api.github.com/users/rossmc/orgs","repos_url":"https://api.github.com/users/rossmc/repos","events_url":"https://api.github.com/users/rossmc/events{/privacy}","received_events_url":"https://api.github.com/users/rossmc/received_events","type":"User","site_admin":false},"created_at":"2015-08-06T12:17:27Z","updated_at":"2015-08-06T12:17:27Z","body":"@danslo cool, thanks for your help :smiley: "}}