cvs: phpdoc /en/language operators.xml

From: Date: Wed, 23 May 2001 23:43:13 +0000
Subject: cvs: phpdoc /en/language operators.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969335538@lists.php.net to get a copy of this message
jeroen Wed May 23 16:43:13 2001 EDT Modified files: /phpdoc/en/language operators.xml Log: Fixed example, added note that @foreach doesn't work, added note that db-functions usually don't cause a php error, and finally added an example to show that its use isn't restricted to functions Index: phpdoc/en/language/operators.xml diff -u phpdoc/en/language/operators.xml:1.17 phpdoc/en/language/operators.xml:1.18 --- phpdoc/en/language/operators.xml:1.17 Mon Jan 22 18:50:39 2001 +++ phpdoc/en/language/operators.xml Wed May 23 16:43:12 2001 @@ -267,12 +267,29 @@ <programlisting role="php"> &lt;?php /* Intentional SQL error (extra quote): */ -$res = @mysql_query ("select name, code from 'namelist") or - die ("Query failed: error was '$php_errormsg'"); +$my_file = @file ('non_esistent_file') or + die ("Failed opening file: error was '$php_errormsg'"); + +// this works for any expression, not just functions: +$value = @$cache[$key]; +// will not issue a notication if the index $key doesn't exist. + ?&gt; </programlisting> </informalexample> </para> + <note> + <simpara> + The @-operator doesn't work with foreach. + </simpara> + </note> + <note> + <simpara> + Most database-functions do not return PHP-errors, rather, + you must use some get_error() function applicable for + your database type. + </simpara> + </note> <simpara> See also <function>error_reporting</function>. </simpara>

« previous php.doc (#969335538) next »