SitePoint Sponsor |
|
User Tag List
Results 1 to 12 of 12
-
May 12, 2009, 16:28 #1
- Join Date
- Apr 2007
- Posts
- 1,205
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
What are some circumstances under which this code...
... will print a blank white page? None of the functions use try/catch blocks or other error handling techiques. If they contained faulty code or triggered a runtime error, it would print an error message - right?
PHP Code:error_reporting(E_ALL);
$var1 = "something";
$var2 = $var1 . " else";
if (empty($var1)) {
echo "Debugging message 1";
doSomething();
}
else {
echo "Debugging message 2";
if ($var2 == "something else") {
echo "Debugging message 3";
doSomethingElse($var1);
}
else {
echo "Debugging message 4";
doAnotherThing();
}
}
Moderators: I previously posted this to the JavaScript forum by mistake. As you may guess, I've had a very long day trying to figure this out.Please delete that thread.
-
May 12, 2009, 16:46 #2What are some circumstances under which this code...
... will print a blank white page?Tweep List adds an avatar menu to Twitter (open source)
Word Stats shows your most used words on Twitter
-
May 12, 2009, 16:59 #3
- Join Date
- Apr 2007
- Posts
- 1,205
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
May 12, 2009, 17:53 #4
Then let us know the cause when you find one
I'm curious.
Tweep List adds an avatar menu to Twitter (open source)
Word Stats shows your most used words on Twitter
-
May 12, 2009, 19:02 #5
- Join Date
- Jul 2006
- Location
- Augusta, Georgia, United States
- Posts
- 4,194
- Mentioned
- 17 Post(s)
- Tagged
- 5 Thread(s)
I get debugging message 2 and 3. You could try using strcmp() instead of equality.
-
May 12, 2009, 19:03 #6
- Join Date
- Mar 2006
- Location
- Gold Coast, Australia
- Posts
- 1,369
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
try adding this as well:
PHP Code:ini_set('display_errors', 1);
Studiotime - Time Management for Web Developers
to-do's, messages, invoicing, reporting - 30 day free trial!
Thomas Multimedia Web Development
-
May 12, 2009, 19:30 #7
- Join Date
- Apr 2007
- Posts
- 1,205
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
May 12, 2009, 20:09 #8
- Join Date
- Jul 2008
- Posts
- 5,757
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Maybe someone realized it should be off by default.
Also, output buffering could trap all output.
-
May 12, 2009, 20:49 #9
- Join Date
- Mar 2008
- Posts
- 1,149
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Perhaps you should hook in Xdebug or Zend Debugger.
-
May 16, 2009, 07:56 #10
- Join Date
- Apr 2007
- Posts
- 1,205
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
There was an errant video player widget on the same dev server as the site I was working on. It was causing seg faults. Someone was modifying a parent class of the widget at the time. I wish I had time to troubleshoot someone else's code because I'm curious about exactly what went wrong. The framework has an insane number of layers of inheritance. I'm surprised it works at all.
-
May 16, 2009, 08:37 #11
- Join Date
- Apr 2008
- Location
- Temecula, CA
- Posts
- 278
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I get:
Debugging message 2Debugging message 3
Fatal error: Call to undefined function doSomethingElse() in E:\wamp\www\script_library\test.php on line 27
-
May 16, 2009, 09:00 #12
- Join Date
- Apr 2007
- Posts
- 1,205
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Bookmarks