#32076 [Opn->Csd]: ReflectionMethod :: isDestructor() always return true
| From: | derick@php.net | Date: | Wed, 23 Feb 2005 12:34:15 +0000 |
| Subject: | #32076 [Opn->Csd]: ReflectionMethod :: isDestructor() always return true | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-74465@lists.php.net to get a copy of this message | ||
ID: 32076
Updated by: derick@php.net
Reported By: fablezouave at gmail dot com
-Status: Open
+Status: Closed
Bug Type: Class/Object related
Operating System: debian/GNU Linux
PHP Version: 5.0.3
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-02-23 09:02:09] fablezouave at gmail dot com
Description:
------------
Hi
It seems that the ReflectionMethod :: isDestructor() method always
return true.
Thanks
Fab
Reproduce code:
---------------
<?php
class Object
{
function __construct(){}
function truc(){}
function __destruct(){}
}
$R = new ReflectionClass('Object');
foreach($R->getMethods() as $val) {
$M = new reflectionMethod($val->class, $val->name);
echo '<h2>'.$val->name.'</h2>';
if($M->isConstructor())
echo 'Constructor<br/>';
// Always return TRUE
if($M->isDestructor())
echo 'Destructor<br/>';
}
?>
Expected result:
----------------
__construct
Constructor
truc
__destruct
Destructor
Actual result:
--------------
__construct
Constructor
Destructor
truc
Destructor
__destruct
Destructor
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32076&edit=1