From 2f156c61f19a889c8ed39fe8eb3b3220555db647 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 9 Mar 2015 12:38:46 +0100 Subject: [PATCH] Add UPDRADING note about yield operator behavior Fixes bug #69160. [ci skip] --- UPGRADING | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/UPGRADING b/UPGRADING index 1e81505f86..e844cc4dcd 100644 --- a/UPGRADING +++ b/UPGRADING @@ -323,6 +323,25 @@ Relevant RFCs: Other language changes ---------------------- +* The yield language construct no longer requires parentheses when used in an + expression context. It is now a right-associative operator with precedence + between the "print" and "=>" operators. This can result in different behavior + in some cases, for example: + + echo yield -1; + // Was previously interpreted as + echo (yield) - 1; + // And is now interpreted as + echo yield (-1); + + yield $foo or die; + // Was previously interpreted as + yield ($foo or die); + // And is now interpreted as + (yield $foo) or die; + + Such cases can always be resolved by adding additional parentheses. + . Removed ASP (<%) and script (