Re: dollars and sense.

From: Date: Tue, 27 Jan 2004 03:31:28 +0000
Subject: Re: dollars and sense.
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-7342@lists.php.net to get a copy of this message
On Mon, 26 Jan 2004, Michael Hawley wrote: > Why must variable names begin with $? I can't see any > real reason, except when signalling a replacement within > a string (e.g., "... $var ..."). The language would be less > cumbersome if the dollar was optional otherwise. Two letters: HA But to answer your question based on current PHP, non-prefixed variables would conflict with define()d constants, which appear as: $foo = 'abc'.bar; Ken ps: sorry, but... heh... pps: don't use "foo $bar blah" -- use 'foo ' . $bar . ' blah'; or commas:)

« previous php.internals (#7342) next »