|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35539 ErrorException treated as Exception
Submitted: 2005-12-04 00:38 UTC Modified: 2005-12-04 12:47 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: marcing at smlw dot pl Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2005-12-04 (snap) OS: Win XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
50 - 22 = ?
Subscribe to this entry?

 [2005-12-04 00:38 UTC] marcing at smlw dot pl
thrown ErrorException accepts 2 arguments instead of 5

Reproduce code:
throw new ErrorException($msg, $code, $severity, $file, $line);

Expected result:
ErrorException should accept 5 arguments:

    Method [ <internal> <ctor> public method __construct ] {

      - Parameters [5] {
        Parameter #0 [ <required> $message ]
        Parameter #1 [ <required> $code ]
        Parameter #2 [ <required> $severity ]
        Parameter #3 [ <optional> $filename ]
        Parameter #4 [ <optional> $lineno ]

Actual result:
Fatal error: Wrong parameter count for exception([string $exception [, long $code ]])


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-04 00:54 UTC]
I can't reproduce it.
Could you try on some different machine? (a *nix would be better)
 [2005-12-04 01:07 UTC] judas dot iscariote at gmail dot com
php  t.php
PHP Fatal error:  Wrong parameter count for exception([string $exception [, long $code ]]) in t.php on line 2
X-Powered-By: PHP/5.1.2-dev

Linux amd64.
 [2005-12-04 01:32 UTC]
./sapi/cli/php -r 'throw new ErrorException($msg, $code, $severity, $file, $line);'

Fatal error: Uncaught exception 'ErrorException' in :0
Stack trace:
#0 {main}
  thrown in  on line 0

./sapi/cli/php -v
PHP 5.1.2-dev (cli) (built: Dec  4 2005 02:47:57)

Do you have any Zend extensions enabled like APC, IonCube, eAccelerator etc. ?
 [2005-12-04 02:22 UTC] judas dot iscariote at gmail dot com
the problem is the error message.

pass incorrect data type in:

Parameter #1 [ <required> $code ] 


Parameter #2 [ <required> $severity ]

and you'll see:

Fatal error: Wrong parameter count for exception...

maybe the error message should tell something different...
 [2005-12-04 10:27 UTC] marcing at smlw dot pl
You r right judas, thanks
 [2005-12-04 12:47 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 26 12:03:37 2021 UTC