{"action":"created","issue":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/11771","repository_url":"https://api.github.com/repos/phalcon/cphalcon","labels_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11771/labels{/name}","comments_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11771/comments","events_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11771/events","html_url":"https://github.com/phalcon/cphalcon/issues/11771","id":153958192,"number":11771,"title":"Passing an object to Volt macro; \"PHP Fatal error:  Cannot use object of type stdClass as array\"","user":{"login":"ilgityildirim","id":4365245,"avatar_url":"https://avatars.githubusercontent.com/u/4365245?v=3","gravatar_id":"","url":"https://api.github.com/users/ilgityildirim","html_url":"https://github.com/ilgityildirim","followers_url":"https://api.github.com/users/ilgityildirim/followers","following_url":"https://api.github.com/users/ilgityildirim/following{/other_user}","gists_url":"https://api.github.com/users/ilgityildirim/gists{/gist_id}","starred_url":"https://api.github.com/users/ilgityildirim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilgityildirim/subscriptions","organizations_url":"https://api.github.com/users/ilgityildirim/orgs","repos_url":"https://api.github.com/users/ilgityildirim/repos","events_url":"https://api.github.com/users/ilgityildirim/events{/privacy}","received_events_url":"https://api.github.com/users/ilgityildirim/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phalcon/cphalcon/labels/Bug%20-%20Medium","name":"Bug - Medium","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/phalcon/cphalcon/milestones/16","html_url":"https://github.com/phalcon/cphalcon/milestones/2.0.12","labels_url":"https://api.github.com/repos/phalcon/cphalcon/milestones/16/labels","id":1750314,"number":16,"title":"2.0.12","description":"","creator":{"login":"sergeyklay","id":1256298,"avatar_url":"https://avatars.githubusercontent.com/u/1256298?v=3","gravatar_id":"","url":"https://api.github.com/users/sergeyklay","html_url":"https://github.com/sergeyklay","followers_url":"https://api.github.com/users/sergeyklay/followers","following_url":"https://api.github.com/users/sergeyklay/following{/other_user}","gists_url":"https://api.github.com/users/sergeyklay/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeyklay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeyklay/subscriptions","organizations_url":"https://api.github.com/users/sergeyklay/orgs","repos_url":"https://api.github.com/users/sergeyklay/repos","events_url":"https://api.github.com/users/sergeyklay/events{/privacy}","received_events_url":"https://api.github.com/users/sergeyklay/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":2,"state":"open","created_at":"2016-05-05T19:41:02Z","updated_at":"2016-05-10T09:43:19Z","due_on":"2016-05-11T21:00:00Z","closed_at":null},"comments":14,"created_at":"2016-05-10T09:08:14Z","updated_at":"2016-05-10T11:44:24Z","closed_at":null,"body":"I updated my server yesterday evening. Today morning I realized I haven't gotten any visitor since yesterday evening. I decided to visit my site and I found it unable to display the pages.\r\n\r\nThere is a problem with Volt's macro feature after an update.\r\n**Volt code**\r\n```` \r\n{%-macro list(var) %}\r\n    dump(var)\r\n{%-endmacro %}\r\n````\r\n\r\n**Generated PHP code**\r\n````\r\n<?php $this->_macros['list'] = function($__p = null) {\r\n    if (isset($__p[0])) {\r\n        $var = $__p[0];\r\n    } else {\r\n        if (isset($__p[\"var\"])) {\r\n            $var = $__p[\"var\"];\r\n        } else {\r\n            throw new \\Phalcon\\Mvc\\View\\Exception(\"Macro 'list' was called without parameter: var\");\r\n        }\r\n    }  ?>\r\n    dump(var)\r\n<?php }; $this->_macros['list'] = \\Closure::bind($this->_macros['list'], $this); ?>\r\n````\r\nThis code generates following error; ````PHP Fatal error:  Cannot use object of type stdClass as array in /var/www/file.volt.php on line 2````\r\n\r\nIf you're like me, added listing etc. via macros, there is chance you will experience the same issue (unless I'm guessing you use arrays instead of objects, not that I have tried it though).\r\n\r\nJust wanted to leave it here and hoping for a fix with next version. I'll be down-grading Phalcon now."},"comment":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/comments/218133777","html_url":"https://github.com/phalcon/cphalcon/issues/11771#issuecomment-218133777","issue_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11771","id":218133777,"user":{"login":"vikilaboy","id":2757887,"avatar_url":"https://avatars.githubusercontent.com/u/2757887?v=3","gravatar_id":"","url":"https://api.github.com/users/vikilaboy","html_url":"https://github.com/vikilaboy","followers_url":"https://api.github.com/users/vikilaboy/followers","following_url":"https://api.github.com/users/vikilaboy/following{/other_user}","gists_url":"https://api.github.com/users/vikilaboy/gists{/gist_id}","starred_url":"https://api.github.com/users/vikilaboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vikilaboy/subscriptions","organizations_url":"https://api.github.com/users/vikilaboy/orgs","repos_url":"https://api.github.com/users/vikilaboy/repos","events_url":"https://api.github.com/users/vikilaboy/events{/privacy}","received_events_url":"https://api.github.com/users/vikilaboy/received_events","type":"User","site_admin":false},"created_at":"2016-05-10T11:44:24Z","updated_at":"2016-05-10T11:44:24Z","body":"2.0.10 works well. 2.1.x also :)\r\nSo 2.0.11 doesn't work"}}