Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,625
    Plugin Contributions
    123

    Default Testing for equality in your PHP script? Take care!

    Do you know what this program outputs?

    Code:
    <?php
    $i = 0;
    $j = 'test string';
    if ($i == $j) { 
       echo 'equal';
    } else {
       echo 'not equal';
    }
    This is how PHP works. Complaining is futile, as this developer discovered:
    https://bugs.php.net/bug.php?id=39579
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Re: Testing for equality in your PHP script? Take care!

    Answer: equal. It got me, too, recently!

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,625
    Plugin Contributions
    123

    Default Re: Testing for equality in your PHP script? Take care!

    Yes, in fact it was your submission and the reference to this bug report that motivated me to make this post. Thanks for documenting your findings so others will learn!
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 

Similar Threads

  1. Overriding the script for LogOff.php
    By neophyte2007 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 25 May 2007, 12:42 PM
  2. Replies: 6
    Last Post: 10 May 2006, 11:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR