|  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
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: michiel at trendserver dot nl
New email:
PHP Version: OS:


 [2004-12-02 14:27 UTC] michiel at trendserver dot nl
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:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-28 21:20 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-03-01 09:39 UTC] michiel at trendserver dot nl
No change, using either or

(can not confirm using a *nix build at this time)
 [2005-03-30 23:10 UTC]
Assigning to the author.
 [2005-06-08 08:49 UTC]
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-2022 The PHP Group
All rights reserved.
Last updated: Wed Dec 07 21:04:14 2022 UTC