title: Can I use string concatenation to define a class CONST in PHP?
body: <p>I know that you can create global constants in terms of each other using string concatenation:</p>
  
  <pre><code>define('FOO', 'foo');
  define('BAR', FOO.'bar');  
  echo BAR;
  </code></pre>
  
  <p>will print 'foobar'.</p>
  
  <p>However, I'm getting an error trying to do the same using class constants.</p>
  
  <pre><code>class foobar {
    const foo = 'foo';
    const foo2 = self::foo;
    const bar = self::foo.'bar';
  }
  </code></pre>
  
  <p>foo2 is defined without issue, but declaring const bar will error out </p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected '.', expecting ',' or ';'</p>
  </blockquote>
  
  <p>I've also tried using functions like sprintf() but it doesn't like the left paren any more than the string concatenator '.'.</p>
  
  <p>So is there any way to create class constants in terms of each other in anything more than a trivial set case like foo2?</p>