[php-src] Issue #14156: Missing visibility check for private abstract trait methods
| From: | iluuu1994 | Date: | Mon, 06 May 2024 16:04:35 +0000 |
| Subject: | [php-src] Issue #14156: Missing visibility check for private abstract trait methods | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246868@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/14156
Author: iluuu1994
### Description
The following code:
```php
<?php
trait T {
public abstract function test();
}
class P {
private function test() {}
}
class C extends P {
use T;
}
```
This passes without errors. There's an intentional BC layer that skips visibility checks for
abstract trait methods (see Zend/tests/traits/abstract_method_4.phpt). However, this should not
include private parent methods, because the trait cannot call those. The whole BC layer is
questionable today, so it might be better to remove it entirely.
### PHP Version
All supported branches
### Operating System
_No response_