Bug #78271 [Ver]: Invalid result of if-else

From: Date: Wed, 10 Jul 2019 14:18:26 +0000
Subject: Bug #78271 [Ver]: Invalid result of if-else
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-221687@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78271&edit=1 ID: 78271 User updated by: marekc at softel dot com dot pl Reported by: marekc at softel dot com dot pl Summary: Invalid result of if-else Status: Verified Type: Bug Package: opcache Operating System: Linux Debian 8.11 64bit PHP Version: 7.3.7 Block user comment: N Private report: N New Comment: List of modules below. I can confirm that after disabling opcache the result is "block1" [PHP Modules] bcmath bz2 calendar Core ctype curl date dba dom exif fileinfo filter ftp gd gettext gmp hash iconv imagick json libxml mbstring mysqli mysqlnd openssl pcre PDO pdo_mysql Phar posix Reflection session SimpleXML soap sockets SPL standard tokenizer xml xmlreader xmlrpc xmlwriter xsl Zend OPcache zip zlib [Zend Modules] Zend OPcache Previous Comments: ------------------------------------------------------------------------ [2019-07-10 13:55:58] sjon@php.net Are you sure? Works fine here; https://3v4l.org/3RYph what additional modules do you have enabled? ------------------------------------------------------------------------ [2019-07-10 13:54:05] nikic@php.net Confirming under opcache. ------------------------------------------------------------------------ [2019-07-10 13:51:27] marekc at softel dot com dot pl 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 this bug report at https://bugs.php.net/bug.php?id=78271&edit=1

« previous php.bugs (#221687) next »