A PHP syntax for discardable assignments
A PHP syntax for discardable assignments
Posted Oct 15, 2020 8:35 UTC (Thu) by Rigrig (subscriber, #105346)In reply to: A PHP syntax for discardable assignments by flewellyn
Parent article: A PHP syntax for discardable assignments
The first use that comes to mind is regular expression subpatterns:
preg_match('/(foo)(bar)(baz)/', 'foobarbaz', $matches);
[, $foo, $bar, $baz] = $matches; // $matches[0] = 'foobarbaz'
