Bug #79353 [NEW]: bad optimizing "Null Coalescing Assignment"
| From: | bugreports at gmail dot com | Date: | Sun, 08 Mar 2020 02:46:54 +0000 |
| Subject: | Bug #79353 [NEW]: bad optimizing "Null Coalescing Assignment" | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-225940@lists.php.net to get a copy of this message | ||
From: bugreports at gmail dot com
Operating system:
PHP version: 7.4Git-2020-03-08 (Git)
Package: opcache
Bug Type: Bug
Bug description:bad optimizing "Null Coalescing Assignment"
Description:
------------
with opcache other than "Null coalescing operator" the "Null Coalescing
Assignment" is not completly optimized out
function a()
{
$test = $test ?? TRUE;
return $test;
}
function b()
{
$test ??= TRUE;
return $test;
}
runtime difference with 50000000 calls:
a(): 3.1884
b(): 3.3666
function name: a
number of ops: 2
----------------------------------------------------------------------------------
5 0* COALESCE ~1
!0
6 1* RETURN
<true>
function name: b
number of ops: 3
----------------------------------------------------------------------------------
11 0* COALESCE ~1
!0
1* ASSIGN $2
!0, <true>
12 2* RETURN
!0
--
Edit bug report at https://bugs.php.net/bug.php?id=79353&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79353&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79353&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79353&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79353&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79353&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79353&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79353&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79353&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79353&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79353&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79353&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79353&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79353&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79353&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79353&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79353&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79353&r=mysqlcfg