{"action":"created","issue":{"url":"https://api.github.com/repos/phptal/PHPTAL/issues/48","repository_url":"https://api.github.com/repos/phptal/PHPTAL","labels_url":"https://api.github.com/repos/phptal/PHPTAL/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/phptal/PHPTAL/issues/48/comments","events_url":"https://api.github.com/repos/phptal/PHPTAL/issues/48/events","html_url":"https://github.com/phptal/PHPTAL/issues/48","id":134280470,"number":48,"title":"Undefined property: PHPTAL_Php_CodeWriter::$_indentation","user":{"login":"monojp","id":5738896,"avatar_url":"https://avatars.githubusercontent.com/u/5738896?v=3","gravatar_id":"","url":"https://api.github.com/users/monojp","html_url":"https://github.com/monojp","followers_url":"https://api.github.com/users/monojp/followers","following_url":"https://api.github.com/users/monojp/following{/other_user}","gists_url":"https://api.github.com/users/monojp/gists{/gist_id}","starred_url":"https://api.github.com/users/monojp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monojp/subscriptions","organizations_url":"https://api.github.com/users/monojp/orgs","repos_url":"https://api.github.com/users/monojp/repos","events_url":"https://api.github.com/users/monojp/events{/privacy}","received_events_url":"https://api.github.com/users/monojp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phptal/PHPTAL/labels/bug%20-%20unconfirmed","name":"bug - unconfirmed","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-17T13:31:05Z","updated_at":"2016-03-19T16:36:17Z","closed_at":null,"body":"Hi there,\r\n\r\nI'm using the latest PHPTAL 1.3.0 via pear and have a project that catches notices and I get the following:\r\n\r\n```\r\nArray\r\n(\r\n    [type] => 8\r\n    [message] => Undefined property: PHPTAL_Php_CodeWriter::$_indentation\r\n    [file] => /usr/share/pear/PHPTAL/Php/CodeWriter.php\r\n    [line] => 143\r\n)\r\n\r\n```\r\nThere seem to be cases where this property never gets created but the \"indent\" method tries to access and modify it. Can I help debugging this or do you have a fix for me?"},"comment":{"url":"https://api.github.com/repos/phptal/PHPTAL/issues/comments/198746257","html_url":"https://github.com/phptal/PHPTAL/issues/48#issuecomment-198746257","issue_url":"https://api.github.com/repos/phptal/PHPTAL/issues/48","id":198746257,"user":{"login":"potherca","id":195757,"avatar_url":"https://avatars.githubusercontent.com/u/195757?v=3","gravatar_id":"","url":"https://api.github.com/users/potherca","html_url":"https://github.com/potherca","followers_url":"https://api.github.com/users/potherca/followers","following_url":"https://api.github.com/users/potherca/following{/other_user}","gists_url":"https://api.github.com/users/potherca/gists{/gist_id}","starred_url":"https://api.github.com/users/potherca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/potherca/subscriptions","organizations_url":"https://api.github.com/users/potherca/orgs","repos_url":"https://api.github.com/users/potherca/repos","events_url":"https://api.github.com/users/potherca/events{/privacy}","received_events_url":"https://api.github.com/users/potherca/received_events","type":"User","site_admin":false},"created_at":"2016-03-19T16:36:16Z","updated_at":"2016-03-19T16:36:16Z","body":"Looking in the code of `PHPTAL_Php_CodeWriter`, [the private property `$_indentation` is set to `0`](https://github.com/phptal/PHPTAL/blob/407c72b8b2cc283718c0c80932a071dee7497fb9/classes/PHPTAL/Php/CodeWriter.php#L502) when the class is instantiated. The bug you describe has been [reported and fixed previously in 2013](https://github.com/phptal/PHPTAL/pull/22).\r\n\r\nCan you confirm the source-code you have does indeed have `private $_indentation = 0;` on line 502 of `PHPTAL_Php_CodeWriter.php`?\r\n\r\nIf this is indeed the case, do you happen to have a reproducible use-case so we can confirm this behaviour?\r\n\r\n<!--\r\nThe only place where a new value is assigned to `PHPTAL_Php_CodeWriter::$_indentation` is in `PHPTAL_Php_CodeWriter::popCodeWriterContext()`. There _could_ potential be a `NULL` assignment there but that couldn't really lead to a \"Undefined property\" error.\r\n-->"}}