php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54967 missing error constants in DOMException
Submitted: 2011-05-31 23:21 UTC Modified: 2011-06-05 01:41 UTC
From: giorgio dot liscio at email dot it Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5.3.6 OS: Irrelevant
Private report: No CVE-ID: None
 [2011-05-31 23:21 UTC] giorgio dot liscio at email dot it
Description:
------------
hi, 
the exception constants are not defined in DOMException class

here are the dom2 constants:
const unsigned short      INDEX_SIZE_ERR                 = 1;
const unsigned short      DOMSTRING_SIZE_ERR             = 2;
const unsigned short      HIERARCHY_REQUEST_ERR          = 3;
const unsigned short      WRONG_DOCUMENT_ERR             = 4;
const unsigned short      INVALID_CHARACTER_ERR          = 5;
const unsigned short      NO_DATA_ALLOWED_ERR            = 6;
const unsigned short      NO_MODIFICATION_ALLOWED_ERR    = 7;
const unsigned short      NOT_FOUND_ERR                  = 8;
const unsigned short      NOT_SUPPORTED_ERR              = 9;
const unsigned short      INUSE_ATTRIBUTE_ERR            = 10;
const unsigned short      INVALID_STATE_ERR              = 11;
const unsigned short      SYNTAX_ERR                     = 12;
const unsigned short      INVALID_MODIFICATION_ERR       = 13;
const unsigned short      NAMESPACE_ERR                  = 14;
const unsigned short      INVALID_ACCESS_ERR             = 15;




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-06-01 07:17 UTC] dtajchreber@php.net
Not sure what you're saying is wrong... but they're defined as global constants:

http://lxr.php.net/opengrok/xref/PHP_5_4/ext/dom/dom_fe.h#56
http://lxr.php.net/opengrok/xref/PHP_5_4/ext/dom/php_dom.c#859

[david@oslo:~]$ php -v
PHP 5.3.7-dev (cli) (built: May 15 2011 18:57:11) (DEBUG)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
[david@oslo:~]$ php -r 'print_r(get_defined_constants());' | grep -i '.*\[dom'
    [DOM_PHP_ERR] => 0
    [DOM_INDEX_SIZE_ERR] => 1
    [DOMSTRING_SIZE_ERR] => 2
    [DOM_HIERARCHY_REQUEST_ERR] => 3
    [DOM_WRONG_DOCUMENT_ERR] => 4
    [DOM_INVALID_CHARACTER_ERR] => 5
    [DOM_NO_DATA_ALLOWED_ERR] => 6
    [DOM_NO_MODIFICATION_ALLOWED_ERR] => 7
    [DOM_NOT_FOUND_ERR] => 8
    [DOM_NOT_SUPPORTED_ERR] => 9
    [DOM_INUSE_ATTRIBUTE_ERR] => 10
    [DOM_INVALID_STATE_ERR] => 11
    [DOM_SYNTAX_ERR] => 12
    [DOM_INVALID_MODIFICATION_ERR] => 13
    [DOM_NAMESPACE_ERR] => 14
    [DOM_INVALID_ACCESS_ERR] => 15
    [DOM_VALIDATION_ERR] => 16
[david@oslo:~]$
 [2011-06-05 01:32 UTC] dtajchreber@php.net
-Status: Open +Status: Bogus
 [2011-06-05 01:32 UTC] dtajchreber@php.net
No feedback. Flipping to bogus.
 [2011-06-05 01:41 UTC] felipe@php.net
I guess him expected they to be class constants.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC