[thelist] PHP and declaring variables...

Tris beertastic at gmail.com
Tue Jan 9 10:51:01 CST 2007


Hi all..
when I started PHP (5 years ago.. or maybe 4... I forget) I learnt
that to create a varaiable, I simply wrote:
$variableName = "variableValue";
OR
$variableInt = 3;

All good, it's worked for years..
Buuuuuut....

During myturningon errors today, I was seeing LOADS of undeclared
variable errors..
so I simply added to the top of each page, the problem variable names,
and a blank value.. eg:
$date = "";
$userName = "";
$score = "";

thus declaring them for later use...

Now this strikes me as a pain in the back side..
Can anyone throw lighton to why I need to do this, OR can I fix the
undeclared variables 'bug' without having a list of blank variales at
the top of each page...?

For now.. i'm off to browse the google... the wonderful goodle of web...
(bad wizard of oz rip off, sorry)

Tris...



-- 
When a person can no longer laugh at himself, it is time for others to
laugh at him.
Thomas Szasz



More information about the thelist mailing list