Date: 08/12/00
- Next message: Egon Schmid ( <email protected>): "Re: [PHP-DEV] Building the latest CVS..."
- Previous message: Sterling Hughes: "[PHP-DEV] Building the latest CVS..."
- In reply to: Stanislav Malyshev: "Re: [PHP-DEV] arithmetic operators in member variable assignments"
- Next in thread: Sam Leibowitz: "RE: [PHP-DEV] arithmetic operators in member variable assignments"
- Reply: Sam Leibowitz: "RE: [PHP-DEV] arithmetic operators in member variable assignments"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Elaborating on this answer, if you want to have non-constant initializers
then move the initialization code to the classes constructor.
Andi
At 05:24 PM 8/11/00 +0300, Stanislav Malyshev wrote:
>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 <email protected>
>+972-3-6139665 ext.106
>
>
>--
>PHP Development Mailing List <http://www.php.net/>
>To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
>For additional commands, e-mail: php-dev-help <email protected>
>To contact the list administrators, e-mail: php-list-admin <email protected>
--- Andi Gutmans <andi <email protected>> http://www.zend.com/-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Egon Schmid ( <email protected>): "Re: [PHP-DEV] Building the latest CVS..."
- Previous message: Sterling Hughes: "[PHP-DEV] Building the latest CVS..."
- In reply to: Stanislav Malyshev: "Re: [PHP-DEV] arithmetic operators in member variable assignments"
- Next in thread: Sam Leibowitz: "RE: [PHP-DEV] arithmetic operators in member variable assignments"
- Reply: Sam Leibowitz: "RE: [PHP-DEV] arithmetic operators in member variable assignments"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

