-
Notifications
You must be signed in to change notification settings - Fork 107
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
trait代码复用机制问题 #688
Comments
如果你想实现,不同的类包含不同的实例,也就是你期望的结果。 那么你只需将 |
补充下,这个问题是属性继承问题。只有 设置为 |
@mowangjuanzi 正常的类里面,父类中的属性被子类重写了。但是用trait提取公共部分,并没有被重写。 |
@mowangjuanzi php/php-src#10937 辛苦看看这个是否是调整 |
Duplicate of php/php-src#10935 这个实现会在 PHP 8.3 中包含。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From manual page: https://php.net/language.oop5.traits
trait代码复用机制问题
代码正常
代码复用不正常
The text was updated successfully, but these errors were encountered: