syntax error in class

[email protected] (Dasn)
Newsgroups php.general
Organization G
Message-ID <op.u7x8wug8iztdz5@bla>
Hello guys, I encountered a syntax error, and cannot figure out the  
reason, for example:
==============================  CODE  ==============================
1:<?php
2:$opts = array ('header'=>'str1'.'str2');
3:?>
===============================
Works fine, but when I try to put it into a class, say:

==============================  CODE  ==============================
1:<?php
2:class Test
3:{
4:    var $opts = array ('header'=>'str1'.'str2');
5:}
6:?>
============================== OUTPUT ==============================
Parse error: syntax error, unexpected '.', expecting ')' in C:\Documents  
and Settings\Administrator\Local Settings\Temp\VI42E5.tmp on line 4
PHP Parse error:  syntax error, unexpected '.', expecting ')' in  
C:\Documents and Settings\Administrator\Local Settings\Temp\VI42E5.tmp on  
line 4
====================================================================

I got the syntax error. Why?

My php version:

D:\>php -version
PHP 5.3.1 (cli) (built: Nov 19 2009 10:17:43)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

I'm currently not on this list, please Cc your comment to me.
Thanks in advance.


-- 
Dasn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.