Bug #77928 [NEW]: echo ('string'==0)?"TRUE":"FALSE"; // TRUE

From: Date: Sat, 20 Apr 2019 17:59:36 +0000
Subject: Bug #77928 [NEW]: echo ('string'==0)?"TRUE":"FALSE"; // TRUE
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220538@lists.php.net to get a copy of this message
From: shamil dot kur at gmail dot com Operating system: Debian PHP version: 7.3.4 Package: *General Issues Bug Type: Bug Bug description:echo ('string'==0)?"TRUE":"FALSE"; // TRUE Description: ------------ Expected: echo ('string'==0)?"TRUE":"FALSE"; // FALSE - OK echo (''==0)?"TRUE":"FALSE"; // TRUE - OK echo ('string'==1)?"TRUE":"FALSE"; // TRUE - OK echo (''==1)?"TRUE":"FALSE"; // FALSE - OK The actual result: PHP 7.3.4 echo ('string'==0)?"TRUE":"FALSE"; // TRUE - it's ERROR echo (''==0)?"TRUE":"FALSE"; // TRUE - OK echo ('string'==1)?"TRUE":"FALSE"; // FALSE - it's ERROR echo (''==1)?"TRUE":"FALSE"; // FALSE - OK Test script: --------------- if(''==0)echo "printed text 0\n"; //this line printed if('string'==0)echo "printed text 1\n"; //this line printed // ERROR if(''==1)echo "printed text 2\n"; //never printed if('string'==1)echo "printed text 3\n"; //never printed // ERROR Expected: printed text 0 printed text 3 The actual result: printed text 0 printed text 1 -- Edit bug report at https://bugs.php.net/bug.php?id=77928&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77928&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77928&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77928&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77928&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77928&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77928&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77928&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77928&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77928&r=support Expected behavior: https://bugs.php.net/fix.php?id=77928&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77928&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77928&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77928&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77928&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77928&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77928&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77928&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77928&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77928&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77928&r=mysqlcfg

« previous php.bugs (#220538) next »