#42957 [Opn->Ana]: Inconsistent line numbering

From: Date: Wed, 31 Oct 2007 10:47:13 +0000
Subject: #42957 [Opn->Ana]: Inconsistent line numbering
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-183@lists.php.net to get a copy of this message
ID: 42957 Updated by: jani@php.net Reported By: felipensp at gmail dot com -Status: Open +Status: Analyzed -Bug Type: Scripting Engine problem +Bug Type: Documentation problem Operating System: Linux PHP Version: 5.2.4 New Comment: It's because ticks are counted from "line 0" (declare) and they end at } which is also counted in. This needs some better documenting. Previous Comments: ------------------------------------------------------------------------ [2007-10-13 18:06:37] felipensp at gmail dot com Description: ------------ The line numbering appear incorrect. Reproduce code: --------------- <?php function test() { static $calls = 0; if ($calls++ < 1) return; $bt = debug_backtrace(); printf("(%d)\n", $bt[0]['line']); } register_tick_function('test'); declare (ticks=1) { $i = 0; $j = 1; $i = 0; $j = 1; $i = 0; $j = 1; // foo } ?> Expected result: ---------------- (16) (17) (18) (18) (19) (19) Actual result: -------------- (16) (17) (17) (18) (18) (20) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42957&edit=1

« previous php.doc.bugs (#183) next »