Re: Class variable interpolation
- From: August Karlstrom <fusionfile@xxxxxxxxx>
- Date: Tue, 28 Oct 2008 14:18:16 +0100
Rik Wasmus wrote:
On Tue, 28 Oct 2008 01:58:40 +0100, August Karlstrom <fusionfile@xxxxxxxxx> wrote:
Hi,
Does anyone know the correct syntax to interpolate a class variable, $x say, inside a string? I tried
"{self::$x}"
but it produces the string
{self::x}
Here it will produce '{self::}', and a notice $x isn't set.
AFAIK, with static variables, one has the same 'problem' as with constants: no interpolation possible,
If that is the case it was probably overlooked by the language developers. I see no reason why static variables could not be interpolated with the syntax above.
just use temporary variables or concatenation.
Right, but it is kind of clumsy.
August
.
- Follow-Ups:
- Re: Class variable interpolation
- From: Curtis
- Re: Class variable interpolation
- References:
- Class variable interpolation
- From: August Karlstrom
- Re: Class variable interpolation
- From: Rik Wasmus
- Class variable interpolation
- Prev by Date: Re: Best development platform? Mac, Windows or Linux?
- Next by Date: Re: Table on several pages
- Previous by thread: Re: Class variable interpolation
- Next by thread: Re: Class variable interpolation
- Index(es):
Relevant Pages
|