Monthly Archives: June 2022

Type the List: A Proposal to support type-casting in PHP’s list language construct

I wrote recently about some changes that I’d like to propose for list() in core PHP for version 8.3: namely that it should work with iterables as well with arrays, and that it should allow a variadic “argument” that would … Continue reading

Posted in PHP | Tagged , , , , | 2 Comments

Default the List: A Proposal to support default values in PHP’s list language construct

I wrote recently about some changes that I’d like to propose for list() in core PHP for version 8.3: namely that it should work with iterables as well with arrays, and that it should allow a variadic “argument” that would … Continue reading

Posted in PHP | Tagged , , , | 3 Comments

Splat the List: A Proposal to support Variadics in PHP’s list language construct

I was thinking recently about how useful PHP’s splat operator (…), also known as variadics or array packing/unpacking, can be. I’ve written about variadics before, here and here. Variadics are incredibly powerful and useful; but there are still some limitations … Continue reading

Posted in PHP | Tagged , , , , , | 3 Comments

List-o-mania

The list() language construct is one of the most powerful constructs in PHP, allowing you to assign one or more elements from an array to specific named variables in a single step; but it may not work in quite the … Continue reading

Posted in PHP | Tagged , | 4 Comments