Hi Tim, Jordan,
One of the points Tim makes that actually matters is how to get user-defined properties on child classes to be carried over to new instances when operators are used to calculate them. (It doesn't really matter that the property is private.) For example, suppose you define a tax rate in a child class. My country currently has a mix of 10% and 8% tax rates, so the tax rate property could contain either 8 or 10. The question here is, if add objects with different tax rates, what should the tax rate of the resulting object be? It may be that we shouldn't calculate objects with different tax rates in the first place, but we need to clarify the behavior when we do actually do so. I've come up with a few options, but none of them are particularly smart. In fact, it's a very bad idea... - If a child class has its own properties, their values must match exactly before any calculations can be performed using operators. - Properties defined in child classes are always uninitialized when calculated by operators. - Always apply the state of the left operand Also, as I was thinking about this, I realized that $roundMode has the same problem. When calculating with an operator, I needed to consider what should happen if two objects have different $roundModes. I'll try to think of some more good ideas, but if you have any suggestions, please let me know. Regards. Saki |
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Saki Takamachi
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Barney Laurance
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Saki Takamachi
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Tim Düsterhus
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Tim Düsterhus
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Barney Laurance
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Jordan LeDoux
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Saki Takamachi
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Tim Düsterhus
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Jordan LeDoux
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Saki Takamachi
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Saki Takamachi
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Saki Takamachi
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Rowan Tommins [IMSoP]
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Saki Takamachi
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Tim Düsterhus
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Rowan Tommins [IMSoP]
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Saki Takamachi
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Saki Takamachi
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Tim Düsterhus
- Re: [PHP-DEV] [RFC] [Discussion] Support object type... Saki Takamachi