rfc:list-syntax-trailing-commas
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:list-syntax-trailing-commas [2017/01/27 15:22] – Updated example sammyk | rfc:list-syntax-trailing-commas [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Trailing Commas In List Syntax ====== | ====== PHP RFC: Trailing Commas In List Syntax ====== | ||
* Version: 0.1 | * Version: 0.1 | ||
- | * Date: 2015-11-03 | + | * Date: 2015-11-03 |
* Author: Sammy Kaye Powers, me@sammyk.me | * Author: Sammy Kaye Powers, me@sammyk.me | ||
- | * Status: | + | * Status: |
* First Published at: https:// | * First Published at: https:// | ||
Line 159: | Line 159: | ||
===== Proposed PHP Version ===== | ===== Proposed PHP Version ===== | ||
- | PHP 7.1 | + | PHP 7.2 |
===== Proposed Voting Choices ===== | ===== Proposed Voting Choices ===== | ||
- | Each trailing comma list syntax | + | Each trailing comma list syntax |
- | - Function/ | + | |
- | | + | ==== Function/ |
- | | + | |
- | | + | <code php> |
- | | + | // Function/ |
- | | + | fooCall( |
+ | $arg1, | ||
+ | $arg2, | ||
+ | $arg3, | ||
+ | ); | ||
+ | |||
+ | // Function/ | ||
+ | function something( | ||
+ | FooBarBazInterface $in, | ||
+ | FooBarBazInterface $out, | ||
+ | ) : bool { | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
+ | |||
+ | ==== Grouped namepaces | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | use Foo\Bar\{ | ||
+ | Foo, | ||
+ | Bar, | ||
+ | Baz, | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
+ | |||
+ | ==== Interface implementations on a class ==== | ||
+ | |||
+ | <code php> | ||
+ | class Foo implements | ||
+ | FooInterface, | ||
+ | BarInterface, | ||
+ | BazInterface, | ||
+ | { | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
+ | |||
+ | ==== Trait implementations on a class ==== | ||
+ | |||
+ | <code php> | ||
+ | class Foo | ||
+ | { | ||
+ | use | ||
+ | FooTrait, | ||
+ | BarTrait, | ||
+ | BazTrait, | ||
+ | ; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
+ | |||
+ | ==== Class member lists ==== | ||
+ | |||
+ | <code php> | ||
+ | class Foo | ||
+ | { | ||
+ | const | ||
+ | A = 1010, | ||
+ | B = 1021, | ||
+ | C = 1032, | ||
+ | D = 1043, | ||
+ | ; | ||
+ | protected | ||
+ | $a = ' | ||
+ | $b = ' | ||
+ | $c = ' | ||
+ | ; | ||
+ | private | ||
+ | $blah, | ||
+ | ; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
+ | |||
+ | ==== Inheriting variables from the parent scope in anonymous functions | ||
+ | |||
+ | <code php> | ||
+ | $foo = function ($bar) use ( | ||
+ | $a, | ||
+ | $b, | ||
+ | $c, | ||
+ | ) { | ||
+ | // . . . | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
===== Patches and Tests ===== | ===== Patches and Tests ===== | ||
The [[https:// | The [[https:// |
rfc/list-syntax-trailing-commas.1485530569.txt.gz · Last modified: 2017/09/22 13:28 (external edit)