Bug #73672 [NEW]: 正则表达式运算顺序疑问

From: Date: Wed, 07 Dec 2016 06:37:12 +0000
Subject: Bug #73672 [NEW]: 正则表达式运算顺序疑问
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205816@lists.php.net to get a copy of this message
From: jay_medivh at foxmail dot com Operating system: windows PHP version: 7.0.14RC1 Package: *General Issues Bug Type: Bug Bug description:正则表达式运算顺序疑问 Description: ------------ 这里有一段程序中的代码 var_dump(18130300 == 18130300 ? "hello world" : 18130300 ? 1 : 2); 如上代码在Java和C#中运行结果为hello world , 但是在php中变成了后边的1,我有疑问,这是php特定的运算顺序的确与Java和C#不同还是其他原因 Test script: --------------- <?php var_dump(18130300 == 18130300 ? "hello world" : 18130300 ? 1 : 2); Expected result: ---------------- hello world Actual result: -------------- 1 -- Edit bug report at https://bugs.php.net/bug.php?id=73672&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73672&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73672&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73672&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=73672&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=73672&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=73672&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=73672&r=needscript Try newer version: https://bugs.php.net/fix.php?id=73672&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=73672&r=support Expected behavior: https://bugs.php.net/fix.php?id=73672&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=73672&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=73672&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=73672&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73672&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=73672&r=dst IIS Stability: https://bugs.php.net/fix.php?id=73672&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=73672&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=73672&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=73672&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=73672&r=mysqlcfg

« previous php.bugs (#205816) next »