php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60726 Class name with namespace in ReflectionClass() returns always false
Submitted: 2012-01-12 13:39 UTC Modified: 2012-01-12 14:05 UTC
From: otakarek at post dot cz Assigned:
Status: Closed Package: Reflection related
PHP Version: 5.3.9 OS: GNU Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
5 + 1 = ?
Subscribe to this entry?

 
 [2012-01-12 13:39 UTC] otakarek at post dot cz
Description:
------------
---
From manual page: http://www.php.net/reflectionclass.getdoccomment#refsect1-reflectionclass.getdoccomment-seealso
---


Test script:
---------------
<?php
/**
* A test class
*
* @param  foo bar
* @return baz
*/
namespace Model;

class Test { }

$rc = new \ReflectionClass('Model\Test');
var_dump($rc->getDocComment())
?>

Expected result:
----------------
string(55) "/** * A test class * * @param foo bar * @return baz */" 

Actual result:
--------------
bool(false) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-12 14:05 UTC] otakarek at post dot cz
-Status: Open +Status: Closed
 [2012-01-12 14:05 UTC] otakarek at post dot cz
In 5.3.3 ok:
<?php
/**
* A test class
*
* @param  foo bar
* @return baz
*/
namespace Model;
class Test { }
$rc = new \ReflectionClass('Model\Test');
var_dump($rc->getDocComment());
?>

In 5.3.9 must be:
<?php
namespace Model;
/**
* A test class
*
* @param  foo bar
* @return baz
*/
class Test { }
$rc = new \ReflectionClass('Model\Test');
var_dump($rc->getDocComment());
?>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 17:01:30 2024 UTC