Note about $array[banana] is bad!

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@55530 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Gabor Hojtsy 2001-08-20 11:57:06 +00:00
parent 230a7539e1
commit fa620da371

View file

@ -1,5 +1,5 @@
<?xml encoding="iso-8859-1"?>
<!-- $Revision: 1.46 $ -->
<!-- $Revision: 1.47 $ -->
<chapter id="language.types">
<title>Types</title>
@ -796,7 +796,7 @@ echo "He drunk some ${beer}s"; // works
<informalexample>
<programlisting role="php">
$fruits = array( 'strawberry' =&gt; 'red' , 'banana' =&gt; 'yellow' );
echo "A banana is $fruits[banana].";
echo "A banana is $fruits[banana]."; // this works, but is wrong <link linkend="language.types.array.foo-bar">see the explanation</link>
echo "This square is $square-&gt;width meters broad.";
echo "This square is $square-&gt;width00 centimeters broad."; // won't work,
// for a solution, see the <link linkend="language.types.string.parsing.complex">complex syntax</link>.