#36543 [Opn->Fbk]: Reflection on exception returns too many methods
| From: | johannes@php.net | Date: | Mon, 27 Feb 2006 14:04:07 +0000 |
| Subject: | #36543 [Opn->Fbk]: Reflection on exception returns too many methods | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-93711@lists.php.net to get a copy of this message | ||
ID: 36543
Updated by: johannes@php.net
Reported By: RQuadling at GMail dot COM
-Status: Open
+Status: Feedback
Bug Type: SPL related
Operating System: Windows
PHP Version: 5.1.2
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2006-02-27 15:03:15] RQuadling at GMail dot COM
Ha.
I disabled the Zend Optimizer (V3.0.0-Beta2) and the issue is resolved.
------------------------------------------------------------------------
[2006-02-27 15:02:14] RQuadling at GMail dot COM
AMEND: Reflecting on any internal class reports duplicate methods.
<?php
foreach(get_declared_classes() as $s_class)
{
Reflection::export(new ReflectionClass($s_class));
}
?>
Run the following code into a log file to see duplicates.
------------------------------------------------------------------------
[2006-02-27 14:55:52] RQuadling at GMail dot COM
Description:
------------
Creating a reflection on the inbuilt exception class returns an
unexpected duplication of all the methods.
Reproduce code:
---------------
<?php
Reflection::export(new ReflectionClass('abstract_generic_exception'));
?>
Expected result:
----------------
Class [ <internal> class Exception ] {
- Constants [0] {
}
- Static properties [0] {
}
- Static methods [0] {
}
- Properties [6] {
Property [ <default> protected $message ]
Property [ <default> private $string ]
Property [ <default> protected $code ]
Property [ <default> protected $file ]
Property [ <default> protected $line ]
Property [ <default> private $trace ]
}
- Methods [9] {
Method [ <internal> final private method __clone ] {
}
Method [ <internal, ctor> public method __construct ] {
- Parameters [2] {
Parameter #0 [ <required> $message ]
Parameter #1 [ <required> $code ]
}
}
Method [ <internal> final public method getMessage ] {
}
Method [ <internal> final public method getCode ] {
}
Method [ <internal> final public method getFile ] {
}
Method [ <internal> final public method getLine ] {
}
Method [ <internal> final public method getTrace ] {
}
Method [ <internal> final public method getTraceAsString ] {
}
Method [ <internal> public method __toString ] {
}
}
}
Actual result:
--------------
Class [ <internal> class Exception ] {
- Constants [0] {
}
- Static properties [0] {
}
- Static methods [0] {
}
- Properties [6] {
Property [ <default> protected $message ]
Property [ <default> private $string ]
Property [ <default> protected $code ]
Property [ <default> protected $file ]
Property [ <default> protected $line ]
Property [ <default> private $trace ]
}
- Methods [18] {
Method [ <internal> final private method __clone ] {
}
Method [ <internal, ctor> public method __construct ] {
- Parameters [2] {
Parameter #0 [ <required> $message ]
Parameter #1 [ <required> $code ]
}
}
Method [ <internal> final public method getMessage ] {
}
Method [ <internal> final public method getCode ] {
}
Method [ <internal> final public method getFile ] {
}
Method [ <internal> final public method getLine ] {
}
Method [ <internal> final public method getTrace ] {
}
Method [ <internal> final public method getTraceAsString ] {
}
Method [ <internal> public method __toString ] {
}
Method [ <internal> public method __toString ] {
}
Method [ <internal> final public method getTraceAsString ] {
}
Method [ <internal> final public method getTrace ] {
}
Method [ <internal> final public method getLine ] {
}
Method [ <internal> final public method getFile ] {
}
Method [ <internal> final public method getCode ] {
}
Method [ <internal> final public method getMessage ] {
}
Method [ <internal, ctor> public method __construct ] {
- Parameters [2] {
Parameter #0 [ <required> $message ]
Parameter #1 [ <required> $code ]
}
}
Method [ <internal> final private method __clone ] {
}
}
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36543&edit=1