cvs: phpdoc /en/language operators.xml

From: Date: Thu, 24 May 2001 03:31:35 +0000
Subject: cvs: phpdoc /en/language operators.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969335541@lists.php.net to get a copy of this message
torben Wed May 23 20:31:35 2001 EDT Modified files: /phpdoc/en/language operators.xml Log: Fixed a typo and elucidated a bit on the use of @ with expressions. Index: phpdoc/en/language/operators.xml diff -u phpdoc/en/language/operators.xml:1.19 phpdoc/en/language/operators.xml:1.20 --- phpdoc/en/language/operators.xml:1.19 Wed May 23 16:44:35 2001 +++ phpdoc/en/language/operators.xml Wed May 23 20:31:35 2001 @@ -267,7 +267,7 @@ <programlisting role="php"> &lt;?php /* Intentional file error */ -$my_file = @file ('non_esistent_file') or +$my_file = @file ('non_existent_file') or die ("Failed opening file: error was '$php_errormsg'"); // this works for any expression, not just functions: @@ -280,7 +280,13 @@ </para> <note> <simpara> - The @-operator doesn't work with foreach. + The @-operator works only on expressions. A simple rule of thumb + is: if you can take the value of something, you can prepend the @ + operator to it. For instance, you can prepend it to variables, + function and <function>include</function> calls, constants, and + so forth. You cannot prepend it to function or class definitions, + or conditional structures such as <literal>if</literal> and + <literal>foreach</literal>, and so forth. </simpara> </note> <note>

« previous php.doc (#969335541) next »