mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
c6b75f9328
* Fix prototype for trait methods Fixes GH-14009 * Clenup do_inheritance_check_on_method() Remove wierd checks and define the behavior by explicit set of flags * Fix naming and indentation --------- Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
23 lines
345 B
PHP
23 lines
345 B
PHP
--TEST--
|
|
GH-14009: Traits inherit prototype
|
|
--FILE--
|
|
<?php
|
|
|
|
class P {
|
|
protected function common() {}
|
|
}
|
|
|
|
class A extends P {}
|
|
|
|
trait T {
|
|
private abstract function common(int $param);
|
|
}
|
|
|
|
class B extends P {
|
|
use T;
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Declaration of P::common() must be compatible with T::common(int $param) in %s on line %d
|