#50068 [Opn]: const problem

From: Date: Tue, 03 Nov 2009 21:11:32 +0000
Subject: #50068 [Opn]: const problem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-144217@lists.php.net to get a copy of this message
ID: 50068 Updated by: ksingla@php.net Reported By: jachym dot tousek at gmail dot com Status: Open Bug Type: Scripting Engine problem Operating System: Windows 7 PHP Version: 5.3.1RC3 New Comment: I think this behavior is by design. const expressions are evaluated at compile time. So only few operations are supported in a const expression and string concatenation is not one of those. I could repro this in PHP 5.2 (after putting it under a class). Previous Comments: ------------------------------------------------------------------------ [2009-11-03 20:16:44] jachym dot tousek at gmail dot com Description: ------------ const is not working Reproduce code: --------------- <?php const ROOT_DIR = __DIR__ . '/..'; //parse error <?php define('ROOT_DIR',__DIR__ . '/..'); //works fine ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50068&edit=1

« previous php.bugs (#144217) next »