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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: otakarek at post dot cz
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 11:01:36 2025 UTC