1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/gh14009_002.phpt
Dmitry Stogov c6b75f9328 Fix prototype for trait methods (#14148)
* 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>
2024-05-06 21:39:30 +03:00

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