Bug #79894 [NEW]: ternary condition perturbates if condition
| From: | fabien dot aurejac at gmail dot com | Date: | Fri, 24 Jul 2020 17:42:22 +0000 |
| Subject: | Bug #79894 [NEW]: ternary condition perturbates if condition | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-228213@lists.php.net to get a copy of this message | ||
From: fabien dot aurejac at gmail dot com
Operating system: debian 10.4
PHP version: 7.2.32
Package: *General Issues
Bug Type: Bug
Bug description:ternary condition perturbates if condition
Description:
------------
When I try this script it should at my point of view return 0 instead of
1 ?
am I mistaken ?
Test script:
---------------
<?php
if (false && true?"1":"2") {
echo 1;
} else {
echo 0;
}
?>
Expected result:
----------------
0
Actual result:
--------------
1
--
Edit bug report at https://bugs.php.net/bug.php?id=79894&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79894&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79894&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79894&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79894&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79894&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79894&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79894&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79894&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79894&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79894&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79894&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79894&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79894&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79894&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79894&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79894&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79894&r=mysqlcfg