You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Alperovitch (JIRA)" <ji...@apache.org> on 2017/10/30 12:22:00 UTC

[jira] [Updated] (NETBEANS-108) No check of type hinting constistency in overwritten methods

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

Alperovitch updated NETBEANS-108:
---------------------------------
    Summary: No check  of type hinting constistency in overwritten methods  (was: No check  of type hinting constistancy in overwritten methods)

> No check  of type hinting constistency in overwritten methods
> -------------------------------------------------------------
>
>                 Key: NETBEANS-108
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-108
>             Project: NetBeans
>          Issue Type: Bug
>          Components: php - Editor
>    Affects Versions: 8.2
>         Environment: Both Windows and Mac OS
>            Reporter: Alperovitch
>
> Let's consider the following code :
> {code}
> class A{
>     function test(int $x) : bool{
>         return $x>0;
>  }
> class B extends A{
>     function test($x){
>         return $x>10;
>     }
> }
> {code}
> With PHP7.0 or 7.1 default parameters, this code would trigger the following error :
> {code}
> Fatal error: Declaration of B::test($a) must be compatible with A::test(int
> $a): bool 
> {code}
> (and I am even not sure that there is any way to parameter PHP so that it does not trigger such error)
> It would be useful if the Editor would flag this issue as a warning or an
> error on the row of the definition of function test in class B.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)