php-src/Zend/tests/closure_use_trailing_comma.phpt
Tyson Andre 4cf8b6f1c9 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
2020-07-21 13:01:27 -04:00

18 lines
180 B
PHP

--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