Skip to content

Instantly share code, notes, and snippets.

@evert
Created June 20, 2013 19:15
Show Gist options
  • Save evert/5825741 to your computer and use it in GitHub Desktop.
Save evert/5825741 to your computer and use it in GitHub Desktop.
<?php
$a = 1;
$b = 2;
$c = 3;
list($a, $b, $c) = false;
var_dump([
$a, $b, $c
]);
/* Returns
array(3) {
[0] =>
NULL
[1] =>
NULL
[2] =>
NULL
}
*/
@primitive-type
Copy link

Also, if you do

list($a, $b, $c) = true;

The result is the same. Even more surprising?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment