php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32076 ReflectionMethod :: isDestructor() always return true
Submitted: 2005-02-23 09:02 UTC Modified: 2005-04-13 00:25 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: fablezouave at gmail dot com Assigned:
Status: Closed Package: Class/Object related
PHP Version: 5.0.3 OS: debian/GNU Linux
Private report: No CVE-ID: None
 [2005-02-23 09:02 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-23 13:34 UTC] derick@php.net
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.


 [2005-04-13 00:25 UTC] johannes@php.net
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 01:01:30 2024 UTC