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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Sat Dec 21 14:01:32 2024 UTC