# dom extension corrupting the Exception class

- Thread: https://externals.io/message/11864
- Original archive: https://news-web.php.net/php.internals/11864
- Started by Kamesh Jayachandran on 2004-08-03T10:36:06+00:00
- Messages: 6
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #11864 — Kamesh Jayachandran — 2004-08-03T10:36:06+00:00

URL: https://externals.io/message/11864#11864

Hi All,
I found the following behaviour. I think it is a bug please clarify.

In php-5.0.0
1)Exception class is registered from zend_exceptions.c
2)After this If I see the common.fn_flags of constructor member of
Exception class entry it is 0x2100(Public Constructor).
Till this point is fine.
3)When dom extension is getting started It registers the DOMException
class to the CG(class_table) in that process it inherits from the
Exception class_entry and gets a constructor member pointer of Exception
class_entry.
4)dom extension startup routine updates this constructor pointer's
class_entry->common.fn_flags|=ZEND_ACC_PROTECTED and hence to 0x2300.
5)This causes me not to get the access specifier of __construct
constructor of Exception class if I access it from as "Public".

Is this a accepted behaviour?
I see even though ReflectionException and SQLiteException extends
Exception they have their __construct method set to some function
pointer or else to `NULL` not just left at all.
This is no the case with DOMException.

With regards
Kamesh Jayachandran

---

## #11865 — Wez Furlong — 2004-08-03T10:52:48+00:00

URL: https://externals.io/message/11864#11865 · In reply to: #11864

Already fixed in HEAD.

On Tue, 03 Aug 2004 03:36:06 -0700, Kamesh Jayachandran
<kameshj@fastmail.fm> wrote:
> Hi All,
> I found the following behaviour. I think it is a bug please clarify.
> 
> In php-5.0.0
> 1)Exception class is registered from zend_exceptions.c
> 2)After this If I see the common.fn_flags of constructor member of
> Exception class entry it is 0x2100(Public Constructor).
> Till this point is fine.
> 3)When dom extension is getting started It registers the DOMException
> class to the CG(class_table) in that process it inherits from the
> Exception class_entry and gets a constructor member pointer of Exception
> class_entry.
> 4)dom extension startup routine updates this constructor pointer's
> class_entry->common.fn_flags|=ZEND_ACC_PROTECTED and hence to 0x2300.
> 5)This causes me not to get the access specifier of __construct
> constructor of Exception class if I access it from as "Public".
> 
> Is this a accepted behaviour?
> I see even though ReflectionException and SQLiteException extends
> Exception they have their __construct method set to some function
> pointer or else to `NULL` not just left at all.
> This is no the case with DOMException.
> 
> With regards
> Kamesh Jayachandran

---

## #11866 — Kamesh Jayachandran — 2004-08-03T11:21:50+00:00

URL: https://externals.io/message/11864#11866 · In reply to: #11865

Hi Wez,
Will the fix be available in 5.0.1?
How to browse the cvs tree of 5.0.1 from the web?

With regards
Kamesh Jayachandran

On Tue, 3 Aug 2004 11:52:48 +0100, "Wez Furlong" <kingwez@gmail.com>
said:
> Already fixed in HEAD.
> 
> On Tue, 03 Aug 2004 03:36:06 -0700, Kamesh Jayachandran
> <kameshj@fastmail.fm> wrote:
> > […]

---

## #11867 — Derick Rethans — 2004-08-03T11:40:57+00:00

URL: https://externals.io/message/11864#11867 · In reply to: #11866

> Hi Wez,
> Will the fix be available in 5.0.1?

HEAD is for 5.1.0-dev, and not 5.0.x. Though I don't know whether Wez
merged it to PHP_5_0 or not.

> How to browse the cvs tree of 5.0.1 from the web?

http://cvs.php.net/php-src/

(trailing / important)

regards,
Derick

---

## #11869 — Wez Furlong — 2004-08-03T12:31:39+00:00

URL: https://externals.io/message/11864#11869 · In reply to: #11867

Marcus made the fixes, and afair, they were merged to PHP_5_0

--Wez.


> 
> 
> > […]
> 
> HEAD is for 5.1.0-dev, and not 5.0.x. Though I don't know whether Wez
> merged it to PHP_5_0 or not.
> 
> > […]
> 
> http://cvs.php.net/php-src/
> 
> (trailing / important)
> 
> regards,
> Derick

---

## #11874 — Edin Kadribasic — 2004-08-03T13:55:31+00:00

URL: https://externals.io/message/11864#11874 · In reply to: #11867

> > […]
>
> http://cvs.php.net/php-src/
>
> (trailing / important)

Or you can use super-secret, ugly, but very functional:

http://viewcvs.php.net/viewcvs.cgi/php-src/?only_with_tag=PHP_5_0

Edin
