Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Bug #19819 Freeze with syntax error in use statement
Submitted: 2013-02-13 16:12 UTC
From: narretz Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.5.0RC1)
PHP Version: 5.3.13 OS: Windows 7
Roadmaps: (Not assigned)    
Subscription  


 [2013-02-13 16:12 UTC] narretz (Martin Staffa)
Description: ------------ when you have use statements that do not end with a semicolon, the sniffer freezes and uses up quite a bit of CPU. Aborting the sniff returns to normal. The problem should occur with all syntax errors in the use statement. Test script: --------------- <?php use Buzz\Message\Request as HttpRequest, class Client extends Curl { } Expected result: ---------------- The sniffer ignores the syntax error and does not report anything. Actual result: -------------- The sniffer freezes with no output.

Comments

 [2013-02-13 16:15 UTC] narretz (Martin Staffa)
Please ignore that Curl is not available to extend the class. I removed the other use statements as they were not necessary to reproduce the bug.
 [2013-02-18 08:02 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Fix committed to github: https://github.com/squizlabs/PHP_CodeSniffer/commit/c3dc9045c9dd7fb5b69002b138 196978a92bd69f