php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30961 Wrong linenumber in ReflectionClass getStartLine()
Submitted: 2004-12-02 14:27 UTC Modified: 2005-06-17 10:34 UTC
Votes:4
Avg. Score:3.5 ± 0.5
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:4 (100.0%)
From: michiel at trendserver dot nl Assigned: helly (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2005-03-01 OS: *
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: michiel at trendserver dot nl
New email:
PHP Version: OS:

 

 [2004-12-02 14:27 UTC] michiel at trendserver dot nl
Description:
------------
The Reflection API has a (minor) bug regarding the getStartLine() function in ReflectionClass. When the reflected class is not a subclass and does not implement any interfaces, the result of getStartLine() is one line off.

Reproduce code:
---------------
<?
    class a
    {
    }

    class b extends a
    {
    }

    $ref1 = new ReflectionClass('a');
    $ref2 = new ReflectionClass('b');
    echo $ref1->getStartLine() . "\n";
    echo $ref2->getStartLine() . "\n";
?>

Expected result:
----------------
2
6

Actual result:
--------------
3
6

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-28 21:20 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-03-01 09:39 UTC] michiel at trendserver dot nl
No change, using either http://snaps.php.net/win32/php5.0-win32-200503010130.zip or http://snaps.php.net/win32/php5-win32-200503010730.zip

(can not confirm using a *nix build at this time)
 [2005-03-30 23:10 UTC] tony2001@php.net
Assigning to the author.
 [2005-06-08 08:49 UTC] dmitry@php.net
Fixed in CVS HEAD and PHP_5_0.
 [2005-06-17 10:34 UTC] michiel at trendserver dot nl
Yep, confirmed. Thanks a lot!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 14:01:29 2024 UTC