|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19049 Variables go missing suddenly (not register_globals related!)
Submitted: 2002-08-22 11:02 UTC Modified: 2002-09-08 16:35 UTC
From: proton at fancreations dot com Assigned:
Status: Closed Package: Variables related
PHP Version: 4.3.0-dev OS: Windows XP Home
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
44 - 33 = ?
Subscribe to this entry?

 [2002-08-22 11:02 UTC] proton at fancreations dot com
I have this function I've been using to find a bug in my script, but that now appears to be a bug in PHP itself:

function debug($msg)
   echo '<b>DEBUG</b>: ' . $msg . '<br/>';

I have this function on a page with a form on it. When I call this function when the form is not submitted yet, everything goes fine, but when I call it when I have submitted the form, it goes fine a couple of times but then it gives me this message, saying that the variable is undefined:

Notice: Undefined variable: msg in f:\website\public_html\test\form.php on line 51

Line 51 is the "echo '<b>'..." line in the function above. 

I get simillar strange behaviour when I create a new object and then in the object's constructor I access $this and it also gives me an undefined variable error.

I get this behaviour with both Apache 2 (2.0.40) and Apache 1 (1.3.26), with PHP versions 4.2.0 and 4.2.2. I haven't tested it on any other versions, but I think it will behave the same.

Sometimes Apache 2 crashes on this, other times it would display the errors. After having this a couple of times, my computer even restarts by itself for some reason!

Apache 1 always displays the error message.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-22 17:21 UTC]
Please try using this CVS snapshot:
For Windows:

There were some fixes lately which might be related.

 [2002-08-23 03:51 UTC] proton at fancreations dot com
With php4-win32-latest I still have the same problem, variables that go undefined suddenly...
 [2002-08-23 07:45 UTC]
Can you give us a complete but short script? (that one function alone is not one :)

 [2002-08-24 11:31 UTC] proton at fancreations dot com
The code which I'm using is over 50 kb of classes. I will try to remove parts of the code which are not used next week and then create a small test script, but I'm a little busy right now.
 [2002-09-08 14:36 UTC] proton at fancreations dot com
It seems that this bug has been fixed in PHP 4.2.3, cause my code now works fine again.

I think it has to do with this entry in the 4.2.3 changelog:
- Fixed several bugs in the multithreaded version that could cause random parse errors, especially on machines with multiple CPUs. (Zeev, Zend Engine)

Sniper, thanks anyway for your time and help!
 [2002-09-08 16:35 UTC]
Heh..nice to hear that. Closing this then.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Oct 20 08:03:35 2021 UTC