list() function in PHP, is it exactly equal to brackets in the first of an expression?

Viewed 89

I already know, the list() function in PHP is not deprecated.

It's working well since PHP 4.

this code:

list($drink, $color, $power) = array('coffee', 'brown', 'caffeine');

is equal to this code:

[$drink, $color, $power] = ['coffee', 'brown', 'caffeine'];

result of both:

$drink = 'coffee';
$color = 'brown';
$power = 'caffeine';

I just want to be sure both codes are exactly equal. and where is the resource in php.net.

1 Answers
Related