{"action":"created","issue":{"url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/issues/27","labels_url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/issues/27/comments","events_url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/issues/27/events","html_url":"https://github.com/greenlion/PHP-SQL-Parser/issues/27","id":88962483,"number":27,"title":"Parser fails when it finds a newline after SELECT statement","user":{"login":"witchi","id":5766508,"avatar_url":"https://avatars.githubusercontent.com/u/5766508?v=3","gravatar_id":"","url":"https://api.github.com/users/witchi","html_url":"https://github.com/witchi","followers_url":"https://api.github.com/users/witchi/followers","following_url":"https://api.github.com/users/witchi/following{/other_user}","gists_url":"https://api.github.com/users/witchi/gists{/gist_id}","starred_url":"https://api.github.com/users/witchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/witchi/subscriptions","organizations_url":"https://api.github.com/users/witchi/orgs","repos_url":"https://api.github.com/users/witchi/repos","events_url":"https://api.github.com/users/witchi/events{/privacy}","received_events_url":"https://api.github.com/users/witchi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/labels/imported","name":"imported","color":"FFFFFF"},{"url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/labels/Priority-Medium","name":"Priority-Medium","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-17T09:07:11Z","updated_at":"2015-06-17T09:07:18Z","closed_at":null,"body":"_From [johnny.c...@gmail.com](https://code.google.com/u/112149023784980472854/) on December 14, 2010 17:06:53_\n\nIf I try :\r\n\r\n$parser = new PHPSQLParser('SELECT\r\nname, 1, test;');\r\n\r\nPHP is giving me error (see method process_select_expr):\r\n- Warning: E_WARNING array_pop() expects parameter 1 to be array, string given\r\n- Fatal error: Cannot use string offset as an array \r\n\r\nA newline after between SELECT and field list makes the parser to fail.\n\n_Original issue: http://code.google.com/p/php-sql-parser/issues/detail?id=1_"},"comment":{"url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/issues/comments/112729898","html_url":"https://github.com/greenlion/PHP-SQL-Parser/issues/27#issuecomment-112729898","issue_url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/issues/27","id":112729898,"user":{"login":"witchi","id":5766508,"avatar_url":"https://avatars.githubusercontent.com/u/5766508?v=3","gravatar_id":"","url":"https://api.github.com/users/witchi","html_url":"https://github.com/witchi","followers_url":"https://api.github.com/users/witchi/followers","following_url":"https://api.github.com/users/witchi/following{/other_user}","gists_url":"https://api.github.com/users/witchi/gists{/gist_id}","starred_url":"https://api.github.com/users/witchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/witchi/subscriptions","organizations_url":"https://api.github.com/users/witchi/orgs","repos_url":"https://api.github.com/users/witchi/repos","events_url":"https://api.github.com/users/witchi/events{/privacy}","received_events_url":"https://api.github.com/users/witchi/received_events","type":"User","site_admin":false},"created_at":"2015-06-17T09:07:18Z","updated_at":"2015-06-17T09:07:18Z","body":"_From [patrik.p...@gmail.com](https://code.google.com/u/117693955347544483433/) on January 17, 2011 00:08:44_\n\ni did it in \"split_sql($sql)\"\r\n\r\nchange \r\n$sql = str_replace(array('\\\\\\'','\\\\\"'),array(\"''\",'\"\"'), $sql)\r\n\r\nto\r\n$sql = str_replace(array(\"\\n\",\"\\r\",'\\\\\\'','\\\\\"'),array(' ',' ',\"''\",'\"\"'), $sql);"}}