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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:31:08+00:00 2026-05-26T08:31:08+00:00

The ever flaky Xdebug is on the fritz at the mo’ (normal service will

  • 0

The ever flaky Xdebug is on the fritz at the mo’ (normal service will be resumed as soon as possible), so I am reduced to “debug by echo”.

echo($path_info['filename'] . '    ' . $licence['issue_timestamp'].'<br>');      
if ($path_info['filename'] != $licence['issue_timestamp'])
{  
die('They are NOT equal');
   $_SESSION['error_messages'][] = 'This licence file has been copied';
   return False;
}
else   
die('They are equal');

outputs

1319266557_   1319266557
They are equal

Any idea what I am doing wrong? Is there something special about (trailing) underscores?

  • 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-26T08:31:09+00:00Added an answer on May 26, 2026 at 8:31 am

    The docs state:

    $a != $b Not equal TRUE if $a is not equal to $b after type juggling.

    And that "type juggling" looks mighty suspicious. Elsewhere on that page, it mentions:

    If you compare a number with a string or the comparison involves numerical strings, then each string is converted to a number and the comparison performed numerically. These rules also apply to the switch statement. The type conversion does not take place when the comparison is === or !== as this involves comparing the type as well as the value.

    And the example is a dead giveaway as to what’s happening in your case:

    var_dump(100 == "1e2"); // 100 == 100 -> true

    In terms of how strings are converted to integers, that can be seen here. The salient bit is (my bold):

    If the string does not contain any of the characters ‘.’, ‘e’, or ‘E’ and the numeric value fits into integer type limits (as defined by PHP_INT_MAX), the string will be evaluated as an integer. In all other cases it will be evaluated as a float.

    The value is given by the initial portion of the string.

    Example: $foo = 1 + "10 Small Pigs"; // $foo is integer (11)

    That’s why "123_" is equal to "123" (a). Bottom line, use !== since that ensures both the value and the type are the same.


    (a) See the online PHP executor:
    enter image description here

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

Sidebar

Related Questions

Ever language has their famous and painfull errors. I will be fun to learn
Ever since I started using .NET, I've just been creating Helper classes or Partial
Ever since switching from TABLE-layout to DIV-layout, one common problem remains: PROBLEM : you
Ever since the publication of Enterprise Integration Patterns people have been using the notation
Ever since Microsoft has introduced the application blocks, I've been bumping into people who
Ever stumbled on a tutorial that you feel is of great value but not
Ever wonder what wikipedia's database schema looks like? I recently read this thread from
Ever since I upgraded to Delphi 2009, I am having terrible experience with TFrame
Ever since I gained experience at a software house I have found it difficult
Ever since deleting the original settings.settings file I have had endless problems getting the

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.