Re: arithmetic operators in member variable assignments
| From: | Stanislav Malyshev | Date: | Fri, 11 Aug 2000 14:24:59 +0000 |
| Subject: | Re: arithmetic operators in member variable assignments | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-28610@lists.php.net to get a copy of this message | ||
SL>> Upon experimentation, I was able to reproduce the error reliably with
SL>> the following code:
SL>>
SL>> <?
SL>> class thing {
SL>> var $member = 12 * 12;
SL>> }
SL>> ?>
SL>>
SL>> That produces a parse error (expecting "," or ";").
SL>>
Sure. Var initializers can be only constants. 12*12 isn't constant, it's
an experssion.
--
Stanislav Malyshev stas@zend.com
+972-3-6139665 ext.106