#30961 [Opn->Fbk]: Wrong linenumber in ReflectionClass getStartLine()

From: Date: Mon, 28 Feb 2005 20:20:16 +0000
Subject: #30961 [Opn->Fbk]: Wrong linenumber in ReflectionClass getStartLine()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-77074@lists.php.net to get a copy of this message
ID: 30961 Updated by: sniper@php.net Reported By: michiel at trendserver dot nl -Status: Open +Status: Feedback Bug Type: Zend Engine 2 problem Operating System: Debian PHP Version: 5.0.2 New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2004-12-09 11:12:24] michiel at trendserver dot nl Also occurs on http://snaps.php.net/win32/php5-win32-200412090730.zip ------------------------------------------------------------------------ [2004-12-02 14:27:21] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30961&edit=1

« previous php.bugs (#77074) next »