This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 270825 - Check consistency of type hinting of overwritten methods
Summary: Check consistency of type hinting of overwritten methods
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Assignee: issues@php
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-07 10:48 UTC by thesailorbreton
Modified: 2017-06-07 10:48 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description thesailorbreton 2017-06-07 10:48:52 UTC
Let's consider the following code :

class A{
	function test(int $x) : bool{
		return $x>0;
	}
}

class B extends A{
	function test($x){
		return $x>10;
	}
}

With PHP7.0+ default parameters, this code would trigger the following error :
Fatal error: Declaration of B::test($a) must be compatible with A::test(int $a): bool 

It could be useful if the Editor would flag this issuue as a warning or an error the definition of function test in class B.