why?

From: Date: Thu, 17 Aug 2000 14:59:44 +0000
Subject: why?
Groups: php.general 
Request: Send a blank email to php-general+get-12240@lists.php.net to get a copy of this message
I am developing php4 on Win2k / Apache 1.3.11 and have encountered a most perplexing behavior. My app includes a set of class files from a base file, and what is happening is that a rather simple line of code I need, that works quite perfectly when embedded directly in the base file, throws a syntax error when it is embedded in the include. the line of code is: var $twoLetterCode = substr(strtolower("any string here"),0,2); echo $twoLetterCode; So when I put this in the base file it works, but if I put it into a file called "test.php" and include it into the base file, I get parse error, expecting T_OLD_FUNCTION...etc and if i remove "var" from the line, I get parse error: expecting '," or ';" So why would this otherwise innocuous-looking code throw errors just because it's included? Thanks for any insight. Jim Jim Abramson jim@spill.net ````````````````````` Spill Industries 391 Broadway NY NY 10013 USA http://www.spill.net ````````````````````` tel +1 212 625 8445 fax +1 212 625 0475

« previous php.general (#12240) next »