Re: 5.4a2 trait attribute name conflict resolution

From: Date: Fri, 22 Jul 2011 17:46:40 +0000
Subject: Re: 5.4a2 trait attribute name conflict resolution
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message

Best practice, always choose trait property names carefully/~unique so that you don't run into conflicts.
Sure, but in this case, I created the conflict intentionally because I *want* to override it, and I'm not allowed to like I am with methods. Don't you think that's inconsistent?
The short answer is it's not a bug but maybe an implementation issue... should it be an E_WARNING instead of E_STRICT?
At least. Consider the situation where I'm using classes/traits from somebody else's library that I may not be intimately familiar with. I'll have to know what every one of their properties is named so I can plan my code accordingly -- else I'll silently start getting their values in what I think are my variables. -- Alex Howansky

Attachment: [application/pkcs7-signature] S/MIME Cryptographic Signature smime.p7s

Thread (18 messages)

« previous php.internals (#54147) next »