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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu Mar 28 09:01:26 2024 UTC