Skip to content

Instantly share code, notes, and snippets.

@salathe
Forked from evert/list.php
Last active December 18, 2015 18:29
Show Gist options
  • Save salathe/5825760 to your computer and use it in GitHub Desktop.
Save salathe/5825760 to your computer and use it in GitHub Desktop.
<?php
$var = "foo";
list($foo, $bar, $baz) = $var;
var_dump($foo, $bar, $baz);
list($foo, $bar, $baz) = "foo";
var_dump($foo, $bar);
/*
string(1) "f"
string(1) "o"
string(1) "o"
NULL
NULL
NULL
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment