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  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 32 - 5 = ?

 
 [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