3 ms·
On the criticisms of PHP on swap, those are way out of date. Swap in php: list(a, b) = [b, a] Multiple return values: [a, b] = function(){ return ["one value
by alexandercrohde 11y ago
On the criticisms of PHP on swap, those are way out of date. Swap in php:
list(a, b) = [b, a]
Multiple return values:
[a, b] = function(){ return ["one value", "another"];};
- TazeTSchnitzel 11y agoEr, that should be: list($a, $b) = [$b, $a]; list($a, $b) = (function(){ return ["one value", "another"];})(); Anyway, it's not even out-of-date, just ignorant. PHP has list() for at least 16 years.