Bug #78271 [NEW]: Invalid result of if-else
| From: | marekc at softel dot com dot pl | Date: | Wed, 10 Jul 2019 13:51:27 +0000 |
| Subject: | Bug #78271 [NEW]: Invalid result of if-else | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-221684@lists.php.net to get a copy of this message | ||
From: marekc at softel dot com dot pl
Operating system: Linux Debian 8.11 64bit
PHP version: 7.3.7
Package: *Programming Data Structures
Bug Type: Bug
Bug description:Invalid result of if-else
Description:
------------
The test script should print "block1" but on 7.3.7 prints "none1". Also
tested on 7.2 and 7.1, it's "block1" there.
Test script:
---------------
<?
function test($a, $b){
if($a==10){$w="x";}else{$w="y";}
if($b){$d1="none";$d2="block";}else{$d1="block";$d2="none";}
echo $d2.$b;
}
test(1,1);
?>
Expected result:
----------------
block1
Actual result:
--------------
none1
--
Edit bug report at https://bugs.php.net/bug.php?id=78271&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78271&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78271&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78271&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=78271&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78271&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78271&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78271&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78271&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78271&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78271&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78271&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78271&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78271&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78271&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=78271&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78271&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78271&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78271&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78271&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78271&r=mysqlcfg