mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Fix #80191: Deprecated example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350797 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
df4203dcc5
commit
3e0354fcfc
1 changed files with 4 additions and 7 deletions
|
@ -1842,12 +1842,9 @@ echo $foo ?? $bar ?? $baz ?? $qux; // outputs 1
|
|||
which will return 0 when the call that triggered the error was preceded by an @.
|
||||
</simpara>
|
||||
<simpara>
|
||||
If the <link linkend="ini.track-errors"><option>track_errors</option></link>
|
||||
feature is enabled, any error message generated by the expression
|
||||
will be saved in the variable
|
||||
<varname>$php_errormsg</varname>.
|
||||
This variable will be overwritten on each error, so check early if you
|
||||
want to use it.
|
||||
Any error message generated by the expression is available in the <literal>"message"</literal>
|
||||
element of the array returned by <function>get_error_last</function>.
|
||||
The result of that function will change on each error, so it needs to be checked early.
|
||||
</simpara>
|
||||
<para>
|
||||
<informalexample>
|
||||
|
@ -1856,7 +1853,7 @@ echo $foo ?? $bar ?? $baz ?? $qux; // outputs 1
|
|||
<?php
|
||||
/* Intentional file error */
|
||||
$my_file = @file ('non_existent_file') or
|
||||
die ("Failed opening file: error was '$php_errormsg'");
|
||||
die ("Failed opening file: error was '" . error_get_last()['message'] . "'");
|
||||
|
||||
// this works for any expression, not just functions:
|
||||
$value = @$cache[$key];
|
||||
|
|
Loading…
Reference in a new issue