Re: string operators for assigning class constants

From: Date: Thu, 21 Feb 2008 12:06:59 +0000
Subject: Re: string operators for assigning class constants
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-35685@lists.php.net to get a copy of this message
On 21.02.2008 01:08, Sebastian wrote: > hi, > > why isn't it possible to assign class constants like this: > > class test > { > const > DIR='dirname'.DIRECTORY_SEPARATOR.'anotherdirname'.DIRECTORY_SEPARATOR; > } Because concatenating is an expression, expressions are executed in runtime (2nd stage) and classes are declared in compile-time (1st stage). -- Wbr, Antony Dovgal

« previous php.internals (#35685) next »