php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21567 die(__LINE__); gives no output
Submitted: 2003-01-10 08:40 UTC Modified: 2003-01-10 08:46 UTC
From: chen at hivemail dot com Assigned:
Status: Not a bug Package: *Programming Data Structures
PHP Version: 4.2.3 OS: Windows XP
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:
MUST BE VALID
Solve the problem:
21 + 35 = ?
Subscribe to this entry?

 
 [2003-01-10 08:40 UTC] chen at hivemail dot com
Dying like this:
die(__LINE__);
Doesn't work, i.e the script dies without any output.

Still, this works as expected:
die(__FILE__);
As does this:
die('Gone to sleep at line: '.__LINE__);

Chen

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-10 08:43 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

die(number) will make PHP exit with exit code "number" and not show any message in this case. This is expected behavior and documented @ http://www.php.net/manual/en/function.exit.php

Derick
 [2003-01-10 08:46 UTC] sander@php.net
Not a bug. __LINE__ is an integer. If you give die() or exit() an integer, PHP will exit with that status. Using die((string) __LINE__) should work.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 19:01:29 2024 UTC