Doc #80191 [NEW]: Deprecated example

From: Date: Tue, 06 Oct 2020 11:21:52 +0000
Subject: Doc #80191 [NEW]: Deprecated example
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17961@lists.php.net to get a copy of this message
From:             Kreweta0 at op dot pl
Operating system: n/a
PHP version:      7.4.11
Package:          *General Issues
Bug Type:         Documentation Problem
Bug description:Deprecated example

Description:
------------
In the PHP manual on page
https://www.php.net/manual/en/language.operators.errorcontrol.php
the
first example has an expression that uses the $php_errormsg variable, as
shown below.

$my_file = @file ('non_existent_file') or
    die ("Failed opening file: error was '$php_errormsg'");

The manual does say that this $php_errormsg variable is set only if
"track_errors" feature is enabled. However, I found out that it is
actually a deprecated feature now. I was slightly confused when I got an
error -- Undefined variable: php_errormsg -- when the example teaches me
how to ignore errors.

I think that another example might serve as a better introduction to the
'@' operator, while this existing one can be shown later as a relic of
the past the reader might see around.



-- 
Edit bug report at https://bugs.php.net/bug.php?id=80191&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=80191&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=80191&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=80191&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=80191&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=80191&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=80191&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=80191&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=80191&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=80191&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=80191&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80191&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=80191&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=80191&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=80191&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=80191&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=80191&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=80191&r=mysqlcfg


Thread (2 messages)

« previous php.doc.bugs (#17961) next »