FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » missing variable
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: missing variable [message #175839 is a reply to message #175838] Sat, 29 October 2011 21:35 Go to previous messageGo to previous message
Thomas Mlynarczyk is currently offline  Thomas Mlynarczyk
Messages: 131
Registered: September 2010
Karma:
Senior Member
bill schrieb:

> $history = "empty appointment filled ";
> echo " history: $history\n";

Looks okay to me.

> when it executes I get a PHP Notice
> PHP Notice: Undefined variable: history in
> /var/www/MP2010-v2/classes/cSchedule.php on line 108

Assuming the two lines of code above are 107 and 108 (and that you
indeed copypasted them) I see no reason for this error.

> however if I use:
> $history = "xxx";
> echo " history: $history\n";
> it executes fine.

Just replacing "empty appointment filled " in the above code with "xxx"
has this effect? That simply cannot be.

> To say I am puzzled is a vast understatement.

From my own experience I can tell that such incomprehensible behaviour
usually indicates a very simple mistake.

> If I paste it into a test script, it runs fine so it is obviously in the
> other 200 lines.

So we will obviously need to see those other lines. Maybe you can trim
them down somewhat. And while doing this you might see the cause of the
problem yourself.

> If I rename the variable "hist" I get the same error

Global search & replace? Or manually just in those two lines?

> THis is running from the command line.

Shouldn't matter, but one never knows.

Greetings,
Thomas


--
Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
(Coluche)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: json and special chars
Next Topic: integer and string what's the difference ?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 29 04:38:19 GMT 2024

Total time taken to generate the page: 0.05051 seconds