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

Summary: Check consistency of type hinting of overwritten methods
Product: php Reporter: thesailorbreton
Component: EditorAssignee: issues@php <issues>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: Macintosh   
OS: Mac OS X   
Issue Type: ENHANCEMENT Exception Reporter:

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.