mirror of
https://github.com/php/php-src.git
synced 2026-04-23 07:58:20 +02:00
f74e30c07c
RFC: https://wiki.php.net/rfc/abstract_trait_method_validation Closes GH-5068.
19 lines
399 B
PHP
19 lines
399 B
PHP
--TEST--
|
|
Abstract method from trait enforced in class
|
|
--FILE--
|
|
<?php
|
|
|
|
trait T {
|
|
abstract public function neededByTheTrait(int $a, string $b);
|
|
}
|
|
|
|
class C {
|
|
use T;
|
|
|
|
public function neededByTheTrait(array $a, object $b) {}
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Declaration of C::neededByTheTrait(array $a, object $b) must be compatible with T::neededByTheTrait(int $a, string $b) in %s on line %d
|