[PHP] variable declaration in class

2002-06-18 Thread Jens Lehmann

Can anyone explain me why the following code causes
the parse error ... unexpected * ...  ?

class test
{
var $a = 2*10;
}

Of course I know why there's a parse error, but I don't
know the reason why PHP doesn't allow this multiplication,
although it allows a statement like e.g. var $a = 20.
I'd be thankful if anyone could enlighten me. I'm using
PHP 4.2. on Win2k.

Jens



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] variable declaration in class

2002-06-18 Thread Analysis Solutions

On Tue, Jun 18, 2002 at 07:21:51PM +0200, Jens Lehmann wrote:
 
 class test
 {
 var $a = 2*10;
 }
 
 Of course I know why there's a parse error, but I don't
 know the reason why PHP doesn't allow this multiplication,

Because, that's why. :)

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php