PHP 7.3: Trailing Commas in Function Calls

Well PHP 7.3 wont have arrow functions (that would be dreamy). However, trailing commas in function calls is an excellent addition coming to PHP 7.3. In PHP 7.3, trailing commas in function calls will be valid syntax. That is to say, you can use trailing commas when calling functions, but not defining them. Trailing commas in function calls are specifically useful for variadic functions: Importantly, this change only affects call syntax, not function declaration! The following syntax is still illegal in PHP 7.3: Using trailing (sometimes referred to as dangling) commas is nice and clean when you want to rearrange an array or append new values.

Read Full Article at

Tags: , , , , , , ,