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 6578237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:44:44+00:00 2026-05-25T15:44:44+00:00

if you run this code: if ( 0==’undefined’) echo ‘true’; else echo ‘false’; you

  • 0

if you run this code:

if ( 0=='undefined') echo 'true'; else echo 'false';

you get ‘true’ which means int 0 equals the string ‘undefined’.

Why is that? what am I missing here?

  • 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-05-25T15:44:44+00:00Added an answer on May 25, 2026 at 3:44 pm

    This table documents that when comparing 0 and "undefined", both are converted to numbers first. And this section says that "undefined" converts to the number 0:

    If the string starts with valid numeric data, this will be the value
    used. Otherwise, the value will be 0 (zero).

    So the results of the comparison are expected, if somewhat surprising for someone new to PHP.

    If you want the comparison to return false because the two operands are not of the same type, PHP provides the identical operator === that does exactly this.

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

Sidebar

Related Questions

I run this code: graphic.addAnimation("standart",new int[] {0,1},1.0,true); which calls the graphic.addAnimation(String,int[],float,boolean) Method: public void
when i run this code : CONADefinitions.CONAPI_FOLDER_INFO2 FolderInfo; int iResult = 0; IntPtr Buffer
I have a question concerning this code which I want to run on QNX:
Why run this code and print whole string? #include <stdio.h> void main() { int
When I run this code: foreach ($tree as $node) { echo str_repeat(' ', $node->tree_depth
If I run this code, var waitRow = $(this).parent().parent().next().get(0); $(waitRow).children('td:nth-child(2)').html('some text').toggle(); toggle is not
Is there any way I can run this code with async:false? I notice the
Sometimes when i run this code I get a process and id and sometimes
When i try to run this code i get the error: Warning: mysql_fetch_array() expects
I am trying to run this code in android using eclips IDE. int maxrow=0;

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.