Parse error on ** (pow)

22 views
Skip to first unread message

ign...@ilm.ru

unread,
Mar 19, 2017, 1:22:00 PM3/19/17
to SonarQube
In PHP 5.6, instead of "pow can be used **, but PHP plugin log "Parse error":

Parse error at line 26 column 20:

16:     }
17:
18:     function MetroMetro_distance_p($longitude1, $latitude1, $longitude2, $latitude2)
19:     {
20:         $koef_lat = 111325;
21:         $koef_lng = 63995;
22:
23:         $r1 = $koef_lng*($longitude1 - $longitude2);
24:         $r2 = $koef_lat*($latitude1 - $latitude2);
25:
26:         $r1q = $r1** 2;
                             ^
27:         $r2q = $r2** 2;
28:         $d = sqrt($r1q + $r2q);
29:
30:         return $d;
31:     }
32:



Elena Vilchik

unread,
Mar 20, 2017, 12:42:46 PM3/20/17
to SonarQube, ign...@ilm.ru
Hello,

Thanks for reporting this, here is a ticket to fix it https://jira.sonarsource.com/browse/SONARPHP-691.

Elena VILCHIK | SonarSource
Language Team
Reply all
Reply to author
Forward
0 new messages