[pmwiki-users] Problem with $FmtPV;

Patrick R. Michaud pmichaud at pobox.com
Tue May 22 13:47:10 CDT 2007


On Tue, May 22, 2007 at 01:05:08PM -0400, Ben Wilson wrote:
> On 5/22/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> >
> >In the case where you had
> >
> >    $FmtPV['$YearWeek'] = 'a2007W19';
> >
> >when PHP evaluates "a2007W19" it sees it as a "bareword string"
> >and automatically treats it as a string.  For example, in PHP I
> >can write:
> >
> >    $x = a2007W19;
> >
> >PHP automaticaly treats the bareword string as though I had written:
> >
> >    $x = 'a2007W19';

I should also note that even though PHP _allows_ a programmer
to write bareword strings in this way, doing so is considered
very bad (and potentially unsafe) programming practice.

Pm



More information about the pmwiki-users mailing list