[ 
https://issues.apache.org/jira/browse/NETBEANS-1701?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Junichi Yamamoto updated NETBEANS-1701:
---------------------------------------
    Component/s:     (was: php - Code)
                 php - Editor

> Multiple assignments to variable inside try catch block
> -------------------------------------------------------
>
>                 Key: NETBEANS-1701
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-1701
>             Project: NetBeans
>          Issue Type: Bug
>          Components: php - Code Analysis, php - Editor
>    Affects Versions: 8.2
>            Reporter: César de la Cal
>            Priority: Minor
>
> Hello dear Netbeans team,
>  
> I found a little issue when analyzing the code that I write in PHP. When I 
> write the following code it points out an issue that is not really an issue:
>  
>  <?php
> $a = false;
> try {
>   function_with_exception();
>   $a = true;
> } catch (Exception$e) {}
>  
> Yields a "You should only use 1 assignment to $a", while something like this 
> works as expected:
> {{<?php}}
> {{$a = false;}}
> {{if(function_that_may_return_false()) {}}
> {{  $a = true;}}
> {{} }}
> I suppose that both pieces of code should be treated equally by the static 
> code analysis. Either both are OK or neither is.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to