#35697 [Opn]: Error while using a defined constant in a concat string

From: Date: Fri, 16 Dec 2005 03:52:05 +0000
Subject: #35697 [Opn]: Error while using a defined constant in a concat string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-90516@lists.php.net to get a copy of this message
ID: 35697 User updated by: bryan at phpandmore dot com Reported By: bryan at phpandmore dot com Status: Open Bug Type: Scripting Engine problem Operating System: Red Hat PHP Version: 5.1.1 New Comment: It works when it is used outside of a class definition. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#90516) next »