Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing visibility check for private abstract trait methods #14156

Open
iluuu1994 opened this issue May 6, 2024 · 1 comment
Open

Missing visibility check for private abstract trait methods #14156

iluuu1994 opened this issue May 6, 2024 · 1 comment

Comments

@iluuu1994
Copy link
Member

Description

The following code:

<?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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
@iluuu1994 and others