You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Junichi Yamamoto (Jira)" <ji...@apache.org> on 2019/10/25 01:47:00 UTC
[jira] [Updated] (NETBEANS-1701) Multiple assignments to variable
inside try catch block
[ 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 Analysis)
> 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 - 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
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists