From a8375e724f12cf6594a8c6e03d0080079ad06931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?= Date: Thu, 28 Nov 2024 15:19:05 +0100 Subject: [PATCH] news: add entry for #395 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: László Várady --- news/fx-feature-395.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 news/fx-feature-395.md diff --git a/news/fx-feature-395.md b/news/fx-feature-395.md new file mode 100644 index 000000000..b8f385fe8 --- /dev/null +++ b/news/fx-feature-395.md @@ -0,0 +1,16 @@ +`=??` assignment operator + +Syntactic sugar operator, which could slightly improve performance as well. + +It can be used to assign a non-null value to the left-hand side. +Evaluation errors from the right-hand side will be suppressed. + +For example, + +`resource.attributes['service.name'] =?? $PROGRAM;` can be used instead of: + +``` +if (isset($PROGRAM)) { + resource.attributes['service.name'] = $PROGRAM; +}; +```