php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67740 SPL Exception names
Submitted: 2014-08-01 23:28 UTC Modified: 2015-03-25 22:08 UTC
From: yosmanyga at gmail dot com Assigned:
Status: Not a bug Package: SPL related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: yosmanyga at gmail dot com
New email:
PHP Version: OS:

 

 [2014-08-01 23:28 UTC] yosmanyga at gmail dot com
Description:
------------
Most of the SPL exceptions describe themselves in the name (see http://php.net/manual/en/spl.exceptions.php):

BadFunctionCallException => Bad function call
BadMethodCallException   => Bad method call
OutOfRangeException      => Out of range

But what about DomainException or LengthException. It doesn't express what's the problem. IMHO it should be called BadDomainAdhereException and InvalidLengthException respectively.

I also see a problem with InvalidArgumentException. An argument with a problem related to an out of range or invalid length is also an invalid argument. So why InvalidArgumentException, LengthException and OutOfRangeException are sibling?

RangeException doesn't describe the problem neither.

Regards,
Yosmany


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-25 22:08 UTC] danack@php.net
-Status: Open +Status: Not a bug
 [2015-03-25 22:08 UTC] danack@php.net
Yes, I agree they are not that great. However they are not so misleading as to be bugs.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 01:01:31 2024 UTC