Bug #19414 [Asn->Csd]: php_cs seems to not track variables correctly in heredocs

From: Date: Fri, 11 May 2012 05:40:58 +0000
Subject: Bug #19414 [Asn->Csd]: php_cs seems to not track variables correctly in heredocs
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-8643@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=19414&edit=1 ID: 19414 Updated by: gsherwood@squiz.net Reported By: andy at petdance dot com Summary: php_cs seems to not track variables correctly in heredocs -Status: Assigned +Status: Closed Type: Bug Package: PHP_CodeSniffer Operating System: CentOS 5 Linux Package Version: 1.3.3 PHP Version: 5.3.6 Assigned To: squiz Roadmap Versions: New Comment: -Status: Assigned +Status: Closed Previous Comments: ------------------------------------------------------------------------ [2012-05-11 06:11:48] squiz -Assigned To: +Assigned To: squiz Fixed in git repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/d8f22be5a02aff870471b024f6 85e23eaaf84297 ------------------------------------------------------------------------ [2012-05-10 00:10:16] petdance Description: ------------ php_cs complains that $parameter is not used, when it clearly is. If you remove the "<?xml...>" line from the heredoc, php_cs no longer warns Test script: --------------- <?php function foo( $parameter ) { return <<<HTML <?xml version="1.0"?> <value>$parameter</value> HTML; } print foo( 'PARAMETER' ); print "\n"; Actual result: -------------- FILE: /home/alester/scraps/sniffbugs.php -------------------------------------------------------------------------------- FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S) -------------------------------------------------------------------------------- 2 | WARNING | The method parameter $parameter is never used -------------------------------------------------------------------------------- ------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=19414&edit=1

« previous php.pear.bugs (#8643) next »