Get comments in a php file
===

i've been trying to get the comments out of a certain .php file on my server, in order to parse it's variables. i thought i found an easy way to do this, however the function i use doesn't return anything, even though i clearly have comments in said file.

here are the comments i use:

    /**
	* @param  foo bar
	* @return baz
	*/

here's my code:

    function GetComments($filename) {
		
		$expr = "/((?:\/\*(?:[^*]|(?:\*+[^*\/]))*\*+\/)|(?:\/\/.*))/";
	
	    $file = fopen($filename, "r");
		$length = filesize($filename);
		$comments = fread($file, $length);
		fclose($file);
	
		preg_match_all($expr, $comments, $matches);
	
		foreach($matches[0] as $id => $variable){
			$comments = str_replace($variable,'',$comments);
		}
	        
		return $comments;
	}

is there something i'm doing wrong? because if so, i'm clearly over looking it.  
any help would be very welcome.