diff --git a/language/control-structures.xml b/language/control-structures.xml index 675aa4c064..2ba21145b4 100644 --- a/language/control-structures.xml +++ b/language/control-structures.xml @@ -1,5 +1,5 @@ - + Control Structures @@ -472,10 +472,12 @@ for (expr1; expr2; expr3): statement; ...; endfor; <literal>foreach</literal> - PHP 4 (not PHP 3) includes a foreach construct, - much like Perl and some other languages. This simply gives an easy - way to iterate over arrays. There are two syntaxes; the second is - a minor but useful extension of the first: + PHP 4 (not PHP 3) includes a foreach construct, much + like Perl and some other languages. This simply gives an easy way to + iterate over arrays. foreach works only on arrays, and + will issue an error when you try to use it on a variable with a different + data type or an uninitialized variables. There are two syntaxes; the + second is a minor but useful extension of the first: