Voting

: two plus six?
(Example: nine)

The Note You're Voting On

anthony dot ossent at live dot fr
8 years ago
a simple example of use to swap two variables :

$a = 'hello';
$b = 'world';

list($a, $b) = [$b, $a];

echo $a . ' ' . $b; //display "world hello"

another example :

function getPosition($x, $y, $z)
{
// ... some operations like $x++...
return [$x, $y, $z];
}

list($x, $y, $z) = getPosition($x ,$y, $z);

<< Back to user notes page

To Top