{"action":"created","issue":{"url":"https://api.github.com/repos/jeremeamia/super_closure/issues/74","labels_url":"https://api.github.com/repos/jeremeamia/super_closure/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/jeremeamia/super_closure/issues/74/comments","events_url":"https://api.github.com/repos/jeremeamia/super_closure/issues/74/events","html_url":"https://github.com/jeremeamia/super_closure/issues/74","id":120438706,"number":74,"title":"self:: usage throws error when unserializing","user":{"login":"joffdd","id":11268548,"avatar_url":"https://avatars.githubusercontent.com/u/11268548?v=3","gravatar_id":"","url":"https://api.github.com/users/joffdd","html_url":"https://github.com/joffdd","followers_url":"https://api.github.com/users/joffdd/followers","following_url":"https://api.github.com/users/joffdd/following{/other_user}","gists_url":"https://api.github.com/users/joffdd/gists{/gist_id}","starred_url":"https://api.github.com/users/joffdd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joffdd/subscriptions","organizations_url":"https://api.github.com/users/joffdd/orgs","repos_url":"https://api.github.com/users/joffdd/repos","events_url":"https://api.github.com/users/joffdd/events{/privacy}","received_events_url":"https://api.github.com/users/joffdd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-04T16:39:08Z","updated_at":"2015-12-04T16:40:58Z","closed_at":null,"body":"I recently started using your Super Closure PHP module in our Yii 1.1 framework when implementing a worker queue. I got a problem there when I used self:: in the closures I want to serialize. In the moment the unserialized closure is called, I get a fatal PHP error:\r\n\r\n> PHP Fatal error:  Call to undefined method SuperClosure\\SerializableClosure::_sendNotifications() in ~~[...]~~/common/vendor/jeremeamia/SuperClosure/src/SerializableClosure.php(153) : eval()'d code on line 2\r\n\r\nLet me provide some information: the closure passed looks like\r\n\r\n```php\r\n        function($users) use ($push_notification,$item_id,$item_type,$link_type,$silent,$app_notification_id){\r\n            self::_sendNotifications($users, $push_notification, $item_id, $item_type, $link_type, $silent, $app_notification_id);\r\n        }\r\n```\r\n\r\nThis is how I unserialize and run the closure:\r\n\r\n```php\r\n$this->body = (new SuperClosure\\Serializer())->unserialize($this->body['_payload']);\r\n$this->exitCode = call_user_func_array($this->body, is_array($this->params) ? $this->params : array());\r\n```\r\n\r\nThe serialized string contains the following:\r\n\r\n```\r\nC:32:\"SuperClosure\\SerializableClosure\":1113:{a:5:{s:4:\"code\";s:234:\"function ($users) use($push_notification, $item_id, $item_type, $link_type, $silent, $app_notification_id) { self::_sendNotifications($users, $push_notification, $item_id, $item_type, $link_type, $silent, $app_notification_id); };\";s:7:\"context\";a:6:{s:17:\"push_notification\";O:16:\"PushNotification\":12:{s:11:\"page_search\";N;s:19:\"CActiveRecord_new\";b:0;s:26:\"CActiveRecord_attributes\";a:7:{s:6:\"status\";i:3;s:16:\"is_category_text\";i:0;s:4:\"week\";i:0;s:4:\"text\";s:19:\"guest4 followed you\";s:4:\"date\";s:19:\"2015-11-27 11:16:39\";s:16:\"app_notification\";s:3:\"314\";s:2:\"id\";s:3:\"412\";}s:23:\"CActiveRecord_related\";a:0:{}s:17:\"CActiveRecord_c\";N;s:18:\"CActiveRecord_pk\";s:3:\"412\";s:21:\"CActiveRecord_alias\";s:1:\"t\";s:15:\"CModel_errors\";a:0:{}s:19:\"CModel_validators\";N;s:17:\"CModel_scenario\";s:6:\"update\";s:14:\"CComponent_e\";N;s:14:\"CComponent_m\";N;}s:7:\"item_id\";s:1:\"1\";s:9:\"item_type\";s:4:\"user\";s:9:\"link_type\";s:12:\"user_profile\";s:6:\"silent\";b:1;s:19:\"app_notification_id\";s:3:\"314\";}s:7:\"binding\";N;s:5:\"scope\";s:23:\"PushNotificationService\";s:8:\"isStatic\";b:1;}}\r\n```\r\n\r\nI'm using the AstAnalyzer, but as I understood the documentation, it should actually work with both analyzers. I'm running on PHP 5.4.16.\r\n\r\n[reported in my email to @jeremeamia on 11/27, copy here for tracking reasons]"},"comment":{"url":"https://api.github.com/repos/jeremeamia/super_closure/issues/comments/162015476","html_url":"https://github.com/jeremeamia/super_closure/issues/74#issuecomment-162015476","issue_url":"https://api.github.com/repos/jeremeamia/super_closure/issues/74","id":162015476,"user":{"login":"GrahamCampbell","id":2829600,"avatar_url":"https://avatars.githubusercontent.com/u/2829600?v=3","gravatar_id":"","url":"https://api.github.com/users/GrahamCampbell","html_url":"https://github.com/GrahamCampbell","followers_url":"https://api.github.com/users/GrahamCampbell/followers","following_url":"https://api.github.com/users/GrahamCampbell/following{/other_user}","gists_url":"https://api.github.com/users/GrahamCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/GrahamCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrahamCampbell/subscriptions","organizations_url":"https://api.github.com/users/GrahamCampbell/orgs","repos_url":"https://api.github.com/users/GrahamCampbell/repos","events_url":"https://api.github.com/users/GrahamCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/GrahamCampbell/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T16:40:58Z","updated_at":"2015-12-04T16:40:58Z","body":"At least for now."}}