Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #1258 > unrolled thread

neither var_dump() nor die() displays anything

Started byJivanmukta <jivanmukta@poczta.onet.pl>
First post2011-04-21 06:07 -0700
Last post2011-04-22 11:08 +0200
Articles 11 — 5 participants

Back to article view | Back to comp.lang.php


Contents

  neither var_dump() nor die() displays anything Jivanmukta <jivanmukta@poczta.onet.pl> - 2011-04-21 06:07 -0700
    Re: neither var_dump() nor die() displays anything Jerry Stuckle <jstucklex@attglobal.net> - 2011-04-21 12:58 -0400
      Re: neither var_dump() nor die() displays anything Jivanmukta <jivanmukta@poczta.onet.pl> - 2011-04-21 10:39 -0700
        Re: neither var_dump() nor die() displays anything Jerry Stuckle <jstucklex@attglobal.net> - 2011-04-21 20:00 -0400
          Re: neither var_dump() nor die() displays anything Jivanmukta <jivanmukta@poczta.onet.pl> - 2011-04-21 18:05 -0700
            Re: neither var_dump() nor die() displays anything Unrest <unrest@nullvector.org> - 2011-04-22 07:31 +0000
            Re: neither var_dump() nor die() displays anything Jerry Stuckle <jstucklex@attglobal.net> - 2011-04-22 06:57 -0400
      Re: neither var_dump() nor die() displays anything Jivanmukta <jivanmukta@poczta.onet.pl> - 2011-04-29 10:34 -0700
    Re: neither var_dump() nor die() displays anything Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com> - 2011-04-22 09:45 +0200
      Re: neither var_dump() nor die() displays anything Jivanmukta <jivanmukta@poczta.onet.pl> - 2011-04-29 10:30 -0700
    Re: neither var_dump() nor die() displays anything Helmut Chang <usenet@helmutchang.at> - 2011-04-22 11:08 +0200

#1258 — neither var_dump() nor die() displays anything

FromJivanmukta <jivanmukta@poczta.onet.pl>
Date2011-04-21 06:07 -0700
Subjectneither var_dump() nor die() displays anything
Message-ID<ca09fd21-6c6c-46f9-b7d0-4ce17c7ecdad@g7g2000pro.googlegroups.com>
I don't see my error, I think. Problem is that only
var_dump($statementNo) displays text(and $statementNo is !empty).
Neither var_dump($message) nor die($message) nor echo '#' displays
text. Function writeToLog() correctly writes to log file.
I failed to run debugging.
Here is my code:

// import_statement.php:
var_dump($statementNo);  // works fine
if (!empty($statementNo)) {
  error(ERRMSG_STATEMENT_ALREADY_IMPORTED); // enters error()
}
echo '#'; // here problem

// functions.inc.php:
function error($message) {
  global $currentUser;
  if (ob_get_length() !== false) {
    ob_end_flush();
  }
  var_dump($message); // here problem
  $page = $_SERVER['SERVER_NAME'] . '/' .
trim($_SERVER['REQUEST_URI'], '/ ');
  $website = trim(ltrim(ltrim(WEBSITE_PUNYCODE, 'http:'), 'https:'),
'/ ');
  $page = mb_strstr($page, $website);
  $page = trim(mb_substr($page, mb_strlen($website)), '/ ');
  writeToLog(null, null, $currentUser, null, null, null, "Application
error: $message Page: $page"); // works fine
  die($message); // here problem
}

Please help. Thanks in advance.

[toc] | [next] | [standalone]


#1259

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-04-21 12:58 -0400
Message-ID<iopnmr$q0e$1@dont-email.me>
In reply to#1258
On 4/21/2011 9:07 AM, Jivanmukta wrote:
> I don't see my error, I think. Problem is that only
> var_dump($statementNo) displays text(and $statementNo is !empty).
> Neither var_dump($message) nor die($message) nor echo '#' displays
> text. Function writeToLog() correctly writes to log file.
> I failed to run debugging.
> Here is my code:
>
> // import_statement.php:
> var_dump($statementNo);  // works fine
> if (!empty($statementNo)) {
>    error(ERRMSG_STATEMENT_ALREADY_IMPORTED); // enters error()
> }
> echo '#'; // here problem
>
> // functions.inc.php:
> function error($message) {
>    global $currentUser;
>    if (ob_get_length() !== false) {
>      ob_end_flush();
>    }
>    var_dump($message); // here problem
>    $page = $_SERVER['SERVER_NAME'] . '/' .
> trim($_SERVER['REQUEST_URI'], '/ ');
>    $website = trim(ltrim(ltrim(WEBSITE_PUNYCODE, 'http:'), 'https:'),
> '/ ');
>    $page = mb_strstr($page, $website);
>    $page = trim(mb_substr($page, mb_strlen($website)), '/ ');
>    writeToLog(null, null, $currentUser, null, null, null, "Application
> error: $message Page: $page"); // works fine
>    die($message); // here problem
> }
>
> Please help. Thanks in advance.

Have you tried looking at your page source?

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#1260

FromJivanmukta <jivanmukta@poczta.onet.pl>
Date2011-04-21 10:39 -0700
Message-ID<50061b1f-2e60-4e0b-97c5-6b891cba4365@r19g2000prm.googlegroups.com>
In reply to#1259
> Have you tried looking at your page source?

If you mean View|Source from a browser - yes, I tried: my page
contains only result of var_dump($statementNo), no other markers nor
text.

[toc] | [prev] | [next] | [standalone]


#1263

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-04-21 20:00 -0400
Message-ID<ioqgei$js$2@dont-email.me>
In reply to#1260
On 4/21/2011 1:39 PM, Jivanmukta wrote:
>> Have you tried looking at your page source?
>
> If you mean View|Source from a browser - yes, I tried: my page
> contains only result of var_dump($statementNo), no other markers nor
> text.

OK, do you have the following in your php.ini file (on your development 
system):

display_errors=on
error_reporting=E_ALL // or E_ALL | E_STRICT

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#1265

FromJivanmukta <jivanmukta@poczta.onet.pl>
Date2011-04-21 18:05 -0700
Message-ID<3a979315-6066-4f9f-9b26-b9ddf66f6937@dn9g2000vbb.googlegroups.com>
In reply to#1263
> OK, do you have the following in your php.ini file (on your development
> system):
> display_errors=on
> error_reporting=E_ALL // or E_ALL | E_STRICT

I added these two lines to my code (before problem):

ini_set('display_errors',1);
error_reporting( E_ALL);

but it didn't help: no error is displayed, I don't know why.

[toc] | [prev] | [next] | [standalone]


#1267

FromUnrest <unrest@nullvector.org>
Date2011-04-22 07:31 +0000
Message-ID<4db12ec8$0$77075$afc38c87@news6.united-newsserver.de>
In reply to#1265
Am Thu, 21 Apr 2011 18:05:53 -0700 schrieb Jivanmukta:

>> OK, do you have the following in your php.ini file (on your development
>> system):
>> display_errors=on
>> error_reporting=E_ALL // or E_ALL | E_STRICT
> 
> I added these two lines to my code (before problem):
> 
> ini_set('display_errors',1);
> error_reporting( E_ALL);
> 
> but it didn't help: no error is displayed, I don't know why.

error_reporting(-1) 
is e_all + e_strict.

Having E_STRICT set, it'll punish you for passing an undefined constant 
to that function. ;)

[toc] | [prev] | [next] | [standalone]


#1271

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-04-22 06:57 -0400
Message-ID<iormv8$squ$1@dont-email.me>
In reply to#1265
On 4/21/2011 9:05 PM, Jivanmukta wrote:
>> OK, do you have the following in your php.ini file (on your development
>> system):
>> display_errors=on
>> error_reporting=E_ALL // or E_ALL | E_STRICT
>
> I added these two lines to my code (before problem):
>
> ini_set('display_errors',1);
> error_reporting( E_ALL);
>
> but it didn't help: no error is displayed, I don't know why.

OK, do you have more than one output buffer?

In fact, why are you using the ob_xxx functions at all?  They just add 
extra load to the server and server no useful purpose except in a few 
very specific cases.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#1330

FromJivanmukta <jivanmukta@poczta.onet.pl>
Date2011-04-29 10:34 -0700
Message-ID<6606f1ca-4857-44fd-ab2d-386280aa0225@e26g2000vbz.googlegroups.com>
In reply to#1259
> Have you tried looking at your page source?

If you mean View|Source in a browser - yes, I tried. The source code
(HTML) contains only result of var_dump($statementNo).
There's no error information although I have error reporting set to
E_ALL.

[toc] | [prev] | [next] | [standalone]


#1268

FromErwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com>
Date2011-04-22 09:45 +0200
Message-ID<4db131f7$0$41114$e4fe514c@news.xs4all.nl>
In reply to#1258
On 4/21/2011 3:07 PM, Jivanmukta wrote:
> I don't see my error, I think. Problem is that only
> var_dump($statementNo) displays text(and $statementNo is !empty).
> Neither var_dump($message) nor die($message) nor echo '#' displays
> text. Function writeToLog() correctly writes to log file.
> I failed to run debugging.
> Here is my code:
>
> // import_statement.php:
> var_dump($statementNo);  // works fine
> if (!empty($statementNo)) {
>    error(ERRMSG_STATEMENT_ALREADY_IMPORTED); // enters error()
> }
> echo '#'; // here problem
>
> // functions.inc.php:
> function error($message) {
>    global $currentUser;
>    if (ob_get_length() !== false) {
>      ob_end_flush();
>    }
>    var_dump($message); // here problem
>    $page = $_SERVER['SERVER_NAME'] . '/' .
> trim($_SERVER['REQUEST_URI'], '/ ');
>    $website = trim(ltrim(ltrim(WEBSITE_PUNYCODE, 'http:'), 'https:'),
> '/ ');
>    $page = mb_strstr($page, $website);
>    $page = trim(mb_substr($page, mb_strlen($website)), '/ ');
>    writeToLog(null, null, $currentUser, null, null, null, "Application
> error: $message Page: $page"); // works fine
>    die($message); // here problem
> }
>
> Please help. Thanks in advance.

Is that code possibly placed in an errorhandler?

Regards,
Erwin Moller



-- 
"That which can be asserted without evidence, can be dismissed without 
evidence."
-- Christopher Hitchens

[toc] | [prev] | [next] | [standalone]


#1329

FromJivanmukta <jivanmukta@poczta.onet.pl>
Date2011-04-29 10:30 -0700
Message-ID<5177cb64-624a-48e9-8631-ba6b8d5b3410@q21g2000vbs.googlegroups.com>
In reply to#1268
> > // import_statement.php:
> > var_dump($statementNo);  // works fine
> > if (!empty($statementNo)) {
> >    error(ERRMSG_STATEMENT_ALREADY_IMPORTED); // enters error()
> > }
> > echo '#'; // here problem
>
> Is that code possibly placed in an errorhandler?

No, it's not. The file import_statement.php is opened via
header('Location: import_statement.php'). The quoted lines are at top
level, not nested in a function.

[toc] | [prev] | [next] | [standalone]


#1269

FromHelmut Chang <usenet@helmutchang.at>
Date2011-04-22 11:08 +0200
Message-ID<iorgj6$afo$1@dont-email.me>
In reply to#1258
Am 21.04.2011 15:07, schrieb Jivanmukta:

> // functions.inc.php:
> function error($message) {
>    global $currentUser;
>    if (ob_get_length() !== false) {
>      ob_end_flush();
>    }
>    var_dump($message); // here problem

Although I couldn't find it documented anywhere, I made the experience, 
that any var_dumps() after an ob_end_clean() don't get displayed. Maybe 
it's the same with your ob_end_flush()?

HTH, Helmut

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web