php.net |  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
Votes:1
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 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: marcing at smlw dot pl
New email:
PHP Version: OS:

 

 [2005-12-04 00:38 UTC] marcing at smlw dot pl
Description:
------------
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 ]])

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-04 00:54 UTC] tony2001@php.net
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] tony2001@php.net
./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 ] 

OR 

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] tony2001@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC