Skip to content

Instantly share code, notes, and snippets.

@kojiromike
Created October 11, 2012 18:30
Show Gist options
  • Save kojiromike/3874540 to your computer and use it in GitHub Desktop.
Save kojiromike/3874540 to your computer and use it in GitHub Desktop.
Interactive shell
php > $x=array(1=>1,2=>1,3.3=>1);
php > $x
php > ;
php > print_r($x);
Array
(
[1] => 1
[2] => 1
[3] => 1
)
php > $x[3.3]
php > ;
php > print_r($x[3.3]);
1
php > print_r($x[3.3asdfadfasdfa]);
Parse error: parse error, expecting `']'' in php shell code on line 1
php > print_r($x[3.31234525234]);
1
php > print_r($x[3]);
1
php > print_r($x["3"]);
1
php > print_r($x["3 ugly men"]);
php > print_r($x["qweic 3"]);
php > print_r($x[3 + 0.1]);
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment