{"action":"opened","issue":{"url":"https://api.github.com/repos/krakjoe/pthreads/issues/765","repository_url":"https://api.github.com/repos/krakjoe/pthreads","labels_url":"https://api.github.com/repos/krakjoe/pthreads/issues/765/labels{/name}","comments_url":"https://api.github.com/repos/krakjoe/pthreads/issues/765/comments","events_url":"https://api.github.com/repos/krakjoe/pthreads/issues/765/events","html_url":"https://github.com/krakjoe/pthreads/issues/765","id":263710944,"number":765,"title":"Pthreads detected an attempt to connect to an object which has already been destroyed","user":{"login":"sdjnsfijsdoiukjl","id":32612621,"avatar_url":"https://avatars1.githubusercontent.com/u/32612621?v=4","gravatar_id":"","url":"https://api.github.com/users/sdjnsfijsdoiukjl","html_url":"https://github.com/sdjnsfijsdoiukjl","followers_url":"https://api.github.com/users/sdjnsfijsdoiukjl/followers","following_url":"https://api.github.com/users/sdjnsfijsdoiukjl/following{/other_user}","gists_url":"https://api.github.com/users/sdjnsfijsdoiukjl/gists{/gist_id}","starred_url":"https://api.github.com/users/sdjnsfijsdoiukjl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdjnsfijsdoiukjl/subscriptions","organizations_url":"https://api.github.com/users/sdjnsfijsdoiukjl/orgs","repos_url":"https://api.github.com/users/sdjnsfijsdoiukjl/repos","events_url":"https://api.github.com/users/sdjnsfijsdoiukjl/events{/privacy}","received_events_url":"https://api.github.com/users/sdjnsfijsdoiukjl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-08T11:23:45Z","updated_at":"2017-10-08T11:23:45Z","closed_at":null,"author_association":"NONE","body":"    <?php\r\n    $v = new Volatile;\r\n    \r\n    $t = new class($v) extends Thread\r\n    {\r\n       function __construct(Volatile $v)\r\n       {\r\n          $this->v = $v;\r\n       }\r\n    \r\n       function run()\r\n       {\r\n         $this->v[] = \"str\";\r\n       }\r\n    };\r\n    \r\n    $t->start(); $t->join();\r\n    \r\n    var_dump($v);\r\n\r\nDump:\r\n\r\n    object(Volatile)#1 (1) {\r\n      [0]=>\r\n      string(3) \"str\"\r\n    }\r\n\r\nIf I do this:\r\n    \r\n    <?php\r\n    $v = new Volatile;\r\n    \r\n    $t = new class($v) extends Thread\r\n    {\r\n       function __construct(Volatile $v)\r\n       {\r\n          $this->v = $v;\r\n       }\r\n       \r\n       function run()\r\n       {\r\n          $this->v[] = [\"array\" => [\"test\"]];\r\n       }\r\n    };\r\n    \r\n    $t->start(); $t->join();\r\n    \r\n    var_dump($v);\r\n\r\nError:\r\n\r\n> Fatal error: Uncaught RuntimeException: pthreads detected an attempt\r\n> to connect to an object which has already been destroyed\r\n\r\nHow to fix this code?\r\n\r\nIt is also not working:\r\n```php\r\n$this->v[] = (array) [\"array\" => [\"test\"]];\r\n```"}}
{"actor":{"display_login":"sdjnsfijsdoiukjl"}}