diff options
author | Tyson Andre <tysonandre775@hotmail.com> | 2020-07-01 13:28:39 -0400 |
---|---|---|
committer | Tyson Andre <tysonandre775@hotmail.com> | 2020-07-21 13:01:27 -0400 |
commit | 4cf8b6f1c9090a75d9012701699f7c363bd7b7a7 (patch) | |
tree | 294cf34f5d030a26b5e45cebaa569ae7fc8e82a3 /Zend/tests/closure_use_trailing_comma.phpt | |
parent | 69a5c561d05c8074afe53b8d545d6a6205343aac (diff) | |
download | php-git-4cf8b6f1c9090a75d9012701699f7c363bd7b7a7.tar.gz |
Support optional comma in closure use list
RFC: https://wiki.php.net/rfc/trailing_comma_in_closure_use_list
Discussion: https://externals.io/message/110715
The release manager has agreed to allow merging of RFCs that have near-unanimous
votes. If an RFC ends up not achieving the required 2/3 majority at the time the
announced voting period closes, this implementation commit will be reverted
in time for the feature freeze.
Closes GH-5793
Diffstat (limited to 'Zend/tests/closure_use_trailing_comma.phpt')
-rw-r--r-- | Zend/tests/closure_use_trailing_comma.phpt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Zend/tests/closure_use_trailing_comma.phpt b/Zend/tests/closure_use_trailing_comma.phpt new file mode 100644 index 0000000000..7bf6e5ce88 --- /dev/null +++ b/Zend/tests/closure_use_trailing_comma.phpt @@ -0,0 +1,17 @@ +--TEST-- +Closure use list can have trailing commas +--FILE-- +<?php + +$b = 'test'; +$fn = function () use ( + $b, + &$a, +) { + $a = $b; +}; +$fn(); +echo "$a\n"; +?> +--EXPECT-- +test |