note 118855 added to language.types.array

From: Date: Wed, 17 Feb 2016 20:10:20 +0000
Subject: note 118855 added to language.types.array
Groups: php.notes 
Request: Send a blank email to php-notes+get-204966@lists.php.net to get a copy of this message
I think your first, main example is needlessly confusing, very confusing to newbies: $array = array( "foo" => "bar", "bar" => "foo", ); It should be removed. For newbies: An array index can be any string value, even a value that is also a value in the array. The value of array["foo"] is "bar". The value of array["bar"] is "foo" The following expressions are both true: $array["foo"] == "bar" $array["bar"] == "foo" ---- Server IP: 72.52.91.14 Probable Submitter: 147.21.8.1 ---- Manual Page -- http://php.net/manual/en/language.types.array.php Edit -- https://master.php.net/note/edit/118855 Del: integrated -- https://master.php.net/note/delete/118855/integrated Del: useless -- https://master.php.net/note/delete/118855/useless Del: bad code -- https://master.php.net/note/delete/118855/bad+code Del: spam -- https://master.php.net/note/delete/118855/spam Del: non-english -- https://master.php.net/note/delete/118855/non-english Del: in docs -- https://master.php.net/note/delete/118855/in+docs Del: other reasons-- https://master.php.net/note/delete/118855 Reject -- https://master.php.net/note/reject/118855 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#204966) next »