php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16127 trigger_error - Invalid error type specified
Submitted: 2002-03-17 11:21 UTC Modified: 2002-03-17 11:44 UTC
From: che at atlantic dot net Assigned:
Status: Not a bug Package: *Configuration Issues
PHP Version: 4.1.2 OS: Windows 2000
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: che at atlantic dot net
New email:
PHP Version: OS:

 

 [2002-03-17 11:21 UTC] che at atlantic dot net
Use the sample code below to reproduce the error.  The second parameter of trigger_error does not function, and the error type always shows up as '2'.  I witnessed this running on 4.10 and 4.12.

set_error_handler('ErrorHandler');

function ErrorHandler($number, $description, $file, $line) 
{
    $file = preg_replace('/\\\\/','/',$file);
    $message = $description . " at line " . $line . " in ". 
        $file . " and error type ".$number;
    print "<script language='JavaScript'>alert('$message')</script>";
    exit -1;
}

trigger_error("Testing",E_ERROR);

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-17 11:44 UTC] sander@php.net
RTM:  "It only works with the E_USER family of constants, and will default to E_USER_NOTICE."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 06 17:01:27 2024 UTC