{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/15434","labels_url":"https://api.github.com/repos/symfony/symfony/issues/15434/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/15434/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/15434/events","html_url":"https://github.com/symfony/symfony/pull/15434","id":98686191,"number":15434,"title":"[property-access] Improvement for Accessing Reference Chain","user":{"login":"zerustech","id":417412,"avatar_url":"https://avatars.githubusercontent.com/u/417412?v=3","gravatar_id":"","url":"https://api.github.com/users/zerustech","html_url":"https://github.com/zerustech","followers_url":"https://api.github.com/users/zerustech/followers","following_url":"https://api.github.com/users/zerustech/following{/other_user}","gists_url":"https://api.github.com/users/zerustech/gists{/gist_id}","starred_url":"https://api.github.com/users/zerustech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zerustech/subscriptions","organizations_url":"https://api.github.com/users/zerustech/orgs","repos_url":"https://api.github.com/users/zerustech/repos","events_url":"https://api.github.com/users/zerustech/events{/privacy}","received_events_url":"https://api.github.com/users/zerustech/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/symfony/symfony/labels/PropertyAccess","name":"PropertyAccess","color":"DDDDDD"},{"url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Needs%20Review","name":"Status: Needs Review","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-03T07:17:47Z","updated_at":"2015-09-14T06:59:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/15434","html_url":"https://github.com/symfony/symfony/pull/15434","diff_url":"https://github.com/symfony/symfony/pull/15434.diff","patch_url":"https://github.com/symfony/symfony/pull/15434.patch"},"body":"Improve performance for the following scenarios:\r\n\r\n- Example 1:\r\n```php\r\n$a = array(\r\n    'a' => array(\r\n        'b' => array(\r\n            'c' => 'old-value'\r\n        )\r\n    )\r\n);\r\n$pa->setValue($a, '[a][b][c]', 'new-value');\r\n// The PropertyAccessor will try to set values for\r\n// $a['a']['b']['c'], $a['a']['b'] and $a['a'],\r\n// but in fact it may terminate the loop\r\n// right after the value of $a[a][b][c] is set,\r\n// because $a, $[a], $[a][b] and $[a][b][c]\r\n// are all passed as reference - the reference chain is not broken.\r\n```\r\n\r\n- Example 2\r\n```php\r\n$b = array(\r\n    'a' => array(\r\n        'b' => array(\r\n            'c' => 'old-value'\r\n        )\r\n    )\r\n)\r\n\r\n$a = new Foo($b);\r\n// In this example, the reference chain of $b is broken,\r\n// because it's passed to $a.value as value\r\n// But its elements are all passed as reference,\r\n// so after setting the value for $b[a][b][c], there is no need\r\n// to set value for $b[a][b] and $b[a]\r\n\r\n$pa->setValue($a, 'value[a][b][c]', 'new-value');\r\n```\r\n\r\n| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | no\r\n| New feature?  | no\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | n/a\r\n| License       | MIT\r\n| Doc PR        | n/a"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/139980006","html_url":"https://github.com/symfony/symfony/pull/15434#issuecomment-139980006","issue_url":"https://api.github.com/repos/symfony/symfony/issues/15434","id":139980006,"user":{"login":"fabpot","id":47313,"avatar_url":"https://avatars.githubusercontent.com/u/47313?v=3","gravatar_id":"","url":"https://api.github.com/users/fabpot","html_url":"https://github.com/fabpot","followers_url":"https://api.github.com/users/fabpot/followers","following_url":"https://api.github.com/users/fabpot/following{/other_user}","gists_url":"https://api.github.com/users/fabpot/gists{/gist_id}","starred_url":"https://api.github.com/users/fabpot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabpot/subscriptions","organizations_url":"https://api.github.com/users/fabpot/orgs","repos_url":"https://api.github.com/users/fabpot/repos","events_url":"https://api.github.com/users/fabpot/events{/privacy}","received_events_url":"https://api.github.com/users/fabpot/received_events","type":"User","site_admin":false},"created_at":"2015-09-14T06:59:20Z","updated_at":"2015-09-14T06:59:20Z","body":":+1: "}}