{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/hhvm/issues/8328","repository_url":"https://api.github.com/repos/facebook/hhvm","labels_url":"https://api.github.com/repos/facebook/hhvm/issues/8328/labels{/name}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/8328/comments","events_url":"https://api.github.com/repos/facebook/hhvm/issues/8328/events","html_url":"https://github.com/facebook/hhvm/pull/8328","id":363620171,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4MDExMjQ2","number":8328,"title":"RFC: Check lvalue of Array_get in ast_check","user":{"login":"fangyi-zhou","id":7815439,"node_id":"MDQ6VXNlcjc4MTU0Mzk=","avatar_url":"https://avatars3.githubusercontent.com/u/7815439?v=4","gravatar_id":"","url":"https://api.github.com/users/fangyi-zhou","html_url":"https://github.com/fangyi-zhou","followers_url":"https://api.github.com/users/fangyi-zhou/followers","following_url":"https://api.github.com/users/fangyi-zhou/following{/other_user}","gists_url":"https://api.github.com/users/fangyi-zhou/gists{/gist_id}","starred_url":"https://api.github.com/users/fangyi-zhou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fangyi-zhou/subscriptions","organizations_url":"https://api.github.com/users/fangyi-zhou/orgs","repos_url":"https://api.github.com/users/fangyi-zhou/repos","events_url":"https://api.github.com/users/fangyi-zhou/events{/privacy}","received_events_url":"https://api.github.com/users/fangyi-zhou/received_events","type":"User","site_admin":false},"labels":[{"id":196857004,"node_id":"MDU6TGFiZWwxOTY4NTcwMDQ=","url":"https://api.github.com/repos/facebook/hhvm/labels/CLA%20Signed","name":"CLA Signed","color":"009900","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-09-25T14:53:25Z","updated_at":"2018-10-09T12:09:38Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/facebook/hhvm/pulls/8328","html_url":"https://github.com/facebook/hhvm/pull/8328","diff_url":"https://github.com/facebook/hhvm/pull/8328.diff","patch_url":"https://github.com/facebook/hhvm/pull/8328.patch"},"body":"Summary: See https://github.com/facebook/hhvm/issues/8314 for context\r\nIn the Array_get lvalue, we only checked whether the array being modified\r\nis a class const member and raised a parse error, so we were able to\r\nreject code like this\r\n\r\n```\r\nclass Foo {\r\n    const varray<int> DATA = varray[42];\r\n    public function foo(): void {\r\n        Foo::DATA[] = -1;\r\n    }\r\n}\r\n```\r\n\r\nIn order for an Array_get lvalue to be valid, the array must be a valid\r\nlvalue. This commit addresses this issue by adding this requirement.\r\n\r\nFor reference, the following code raises fatal in PHP\r\n\r\n```\r\n<?php\r\n\r\nconst FOO = array(42);\r\nFOO[] = -1;\r\n```\r\n\r\nbut was accepted by HackC\r\n\r\nNote: There is an issue with references returned by a function\r\nSee quick/vector-stack-base.php"},"comment":{"url":"https://api.github.com/repos/facebook/hhvm/issues/comments/428167554","html_url":"https://github.com/facebook/hhvm/pull/8328#issuecomment-428167554","issue_url":"https://api.github.com/repos/facebook/hhvm/issues/8328","id":428167554,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODE2NzU1NA==","user":{"login":"facebook-github-bot","id":6422482,"node_id":"MDQ6VXNlcjY0MjI0ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/6422482?v=4","gravatar_id":"","url":"https://api.github.com/users/facebook-github-bot","html_url":"https://github.com/facebook-github-bot","followers_url":"https://api.github.com/users/facebook-github-bot/followers","following_url":"https://api.github.com/users/facebook-github-bot/following{/other_user}","gists_url":"https://api.github.com/users/facebook-github-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook-github-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook-github-bot/subscriptions","organizations_url":"https://api.github.com/users/facebook-github-bot/orgs","repos_url":"https://api.github.com/users/facebook-github-bot/repos","events_url":"https://api.github.com/users/facebook-github-bot/events{/privacy}","received_events_url":"https://api.github.com/users/facebook-github-bot/received_events","type":"User","site_admin":false},"created_at":"2018-10-09T12:09:38Z","updated_at":"2018-10-09T12:09:38Z","author_association":"NONE","body":"[@fangyi-zhou](https://github.com/fangyi-zhou) has updated the pull request. [Re-import the pull request](https://our.intern.facebook.com/intern/opensource/github/pull_request/confirm/import/289641781868834/)"}}
{"actor":{"display_login":"facebook-github-bot"}}