Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8124027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:20:44+00:00 2026-06-06T06:20:44+00:00

Something that I think is really strange is happening when I use die() .

  • 0

Something that I think is really strange is happening when I use die(). The following code produces no output:

die($test);

However, the following code does output the integer value stored in $test:

die('test: ' . $test);

Why on earth would that be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T06:20:46+00:00Added an answer on June 6, 2026 at 6:20 am

    die is the same as exit, and since $test is an integer, you’re calling exit with an integer argument. In your second version, you’re creating a string, which results in the string being displayed.

    Have a look at this:

    http://www.php.net/manual/en/function.exit.php

    void exit ([ string $status ] )
    void exit ( int $status )
    

    “If status is a string, this function prints the status just before exiting.

    If status is an integer, that value will be used as the exit status and not printed. Exit statuses should be in the range 0 to 254, the exit status 255 is reserved by PHP and shall not be used. The status 0 is used to terminate the program successfully.”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

One of my (senior) coworkers does something really strange in his code. Instead of
I'm think something like Facebook apps here. User generated pieces of code that people
I'm trying to find a way to to do something that I think must
I'm trying to do something that i would think to be rather simple. I
Last night I think I did something that hosed my rails development environment, and
I want to make something that makes much sense, but I think its not
Do you think that C# will support something like ??= operator? Instead of this:
I've got a really strange error and any light that anyone can shed on
I have strange issue. And normally on strange issues I've done something really stupid.
I'm playing with RavenDb and wondering if I'm missing something obvious. Thing is, that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.