Doc #79673 [Com]: "roughly equivalent to" without explaining the difference
Edit report at https://bugs.php.net/bug.php?id=79673&edit=1
ID: 79673
Comment by: dorcamelda at gmail dot com
Reported by: kasperheij at hotmail dot com
Summary: "roughly equivalent to" without explaining the
difference
Status: Open
Type: Documentation Problem
Package: Documentation problem
PHP Version: 7.4.6
Block user comment: N
Private report: N
New Comment:
Among other courses, biology coursework writing services has become popular since students seek
Biology Assignment Writing Services and biology research writing services.
https://www.meldaresearch.com/biology-assignment-writing-services/
Previous Comments:
------------------------------------------------------------------------
[2020-06-17 21:54:33] a at b dot c dot de
The "??=" operator isn't mentioned at all in the reference part of the documentation
(under neither "comparison operators", where the base '??' is given; nor
"assignment operators", which description of "combined operators" hasn't
been updated). One of those would be the place to describe its behaviour and how it's different
from the more long-winded form.
------------------------------------------------------------------------
[2020-06-10 18:18:27] alexinbeijing at gmail dot com
Interesting question!
I can't find any difference in the actual behavior, although the bytecodes executed by the
interpreter are different in either case, so it is possible that there might be some (very small)
difference in performance.
See:
https://3v4l.org/Z3dPV/vld#output
https://3v4l.org/2W7W1/vld#output
------------------------------------------------------------------------
[2020-06-04 11:21:51] kasperheij at hotmail dot com
Description:
------------
---
From manual page: https://php.net/migration74.new-features
---
```
<?php
$array['key'] ??= computeDefault();
// is roughly equivalent to
if (!isset($array['key'])) {
$array['key'] = computeDefault();
}
?>
```
"// is roughly equivalent to" says that there _is_ a difference without specifying this
delta.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79673&edit=1
Thread (7 messages)