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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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: Thu May 02 09:01:28 2024 UTC