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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

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: Thu Apr 25 09:01:29 2024 UTC