ID: 35697 Updated by: [EMAIL PROTECTED] Reported By: bryan at phpandmore dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Red Hat PHP Version: 5.1.1 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Default values for class properties must be literals. Previous Comments: ------------------------------------------------------------------------ [2005-12-16 04:52:04] bryan at phpandmore dot com It works when it is used outside of a class definition. ------------------------------------------------------------------------ [2005-12-16 04:51:20] bryan at phpandmore dot com This is used inside a class definition. ------------------------------------------------------------------------ [2005-12-16 04:34:06] bryan at phpandmore dot com Description: ------------ I am defining a constant named SITE_ROOT, and it contains the value "/homepages/29/d113403321/htdocs". When I try to use it in Smarty.class.php, on line 75 or the latest stable version 2.6.11, and I get this parse error. I changed the coding for the class variables so that they would not issue a notice b/c of using var rather than public: Parse error: parse error, unexpected '.', expecting ',' or ';' in /homepages/29/d113403321/htdocs/dev/smarty/Smarty.class.php on line 75 Reproduce code: --------------- define("SITE_ROOT", '/homepages/29/d113403321/htdocs'); public $template_dir = SITE_ROOT2 . '/dev/smarty/templates'; Expected result: ---------------- $template_dir having a value of /homepages/29/d113403321/htdocs/dev/smarty/templates Actual result: -------------- parse error ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35697&edit=1