php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #27459 Error handling page should use constants instead of raw integers
Submitted: 2004-03-02 09:29 UTC Modified: 2004-03-02 10:14 UTC
From: cellog@php.net Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: na
Private report: No CVE-ID: None
 [2004-03-02 09:29 UTC] cellog@php.net
Description:
------------
at

http://www.php.net/manual/en/ref.errorfunc.php

the example uses raw integers instead of error constants:

   $errortype = array (
               1    =>  "Error",
               2    =>  "Warning",
               4    =>  "Parsing Error",
               8    =>  "Notice",
               16  =>  "Core Error",
               32  =>  "Core Warning",
               64  =>  "Compile Error",
               128  =>  "Compile Warning",
               256  =>  "User Error",
               512  =>  "User Warning",
               1024 =>  "User Notice"
               );

This should use E_ERROR, E_WARNING, etc.  Using the raw numbers is not best practice, and should not be encouraged.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-02 09:36 UTC] derick@php.net
in addition to this the example missses E_STRICT and the information in the table above has "PHP 4 only" while correct is "PHP 4 and PHP 5 only".
 [2004-03-02 10:14 UTC] didou@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Nov 19 22:00:02 2025 UTC