{"action":"created","issue":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/11578","repository_url":"https://api.github.com/repos/phalcon/cphalcon","labels_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11578/labels{/name}","comments_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11578/comments","events_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11578/events","html_url":"https://github.com/phalcon/cphalcon/pull/11578","id":142448362,"number":11578,"title":"Fix segfault on PHP 7","user":{"login":"Bellardia","id":95552,"avatar_url":"https://avatars.githubusercontent.com/u/95552?v=3","gravatar_id":"","url":"https://api.github.com/users/Bellardia","html_url":"https://github.com/Bellardia","followers_url":"https://api.github.com/users/Bellardia/followers","following_url":"https://api.github.com/users/Bellardia/following{/other_user}","gists_url":"https://api.github.com/users/Bellardia/gists{/gist_id}","starred_url":"https://api.github.com/users/Bellardia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bellardia/subscriptions","organizations_url":"https://api.github.com/users/Bellardia/orgs","repos_url":"https://api.github.com/users/Bellardia/repos","events_url":"https://api.github.com/users/Bellardia/events{/privacy}","received_events_url":"https://api.github.com/users/Bellardia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-03-21T19:33:50Z","updated_at":"2016-03-23T10:13:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/phalcon/cphalcon/pulls/11578","html_url":"https://github.com/phalcon/cphalcon/pull/11578","diff_url":"https://github.com/phalcon/cphalcon/pull/11578.diff","patch_url":"https://github.com/phalcon/cphalcon/pull/11578.patch"},"body":"Back porting some code from 2.0.0 branch, and including an update for PHP 7.0.\r\n\r\nCurrent implementation results in a SEGFAULT when run under PHP 7.0, stemming from the below code in `mvc/model/query/builder.zep`\r\n```\r\nlet query = <QueryInterface> dependencyInjector->get(\"Phalcon\\\\Mvc\\\\Model\\\\Query\", [phql, dependencyInjector]);\r\n```\r\n\r\nI could potentially fix through `create_instance_params`, but I can't find where that function is defined - nor `is_php_version` for that matter.\r\n\r\nNo unit tests since PHP 7 is not running on travis."},"comment":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/comments/200282079","html_url":"https://github.com/phalcon/cphalcon/pull/11578#issuecomment-200282079","issue_url":"https://api.github.com/repos/phalcon/cphalcon/issues/11578","id":200282079,"user":{"login":"Green-Cat","id":3328823,"avatar_url":"https://avatars.githubusercontent.com/u/3328823?v=3","gravatar_id":"","url":"https://api.github.com/users/Green-Cat","html_url":"https://github.com/Green-Cat","followers_url":"https://api.github.com/users/Green-Cat/followers","following_url":"https://api.github.com/users/Green-Cat/following{/other_user}","gists_url":"https://api.github.com/users/Green-Cat/gists{/gist_id}","starred_url":"https://api.github.com/users/Green-Cat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Green-Cat/subscriptions","organizations_url":"https://api.github.com/users/Green-Cat/orgs","repos_url":"https://api.github.com/users/Green-Cat/repos","events_url":"https://api.github.com/users/Green-Cat/events{/privacy}","received_events_url":"https://api.github.com/users/Green-Cat/received_events","type":"User","site_admin":false},"created_at":"2016-03-23T10:13:34Z","updated_at":"2016-03-23T10:13:34Z","body":"It is a built-in function in zephir, here's the optimizer: https://github.com/phalcon/zephir/blob/7cfd109f599fc0e554318b66afc3fc4d0433c297/Library/Optimizers/FunctionCall/CreateInstanceParamsOptimizer.php"}}