#42957 [Ana->Bgs]: Inconsistent line numbering
| From: | vrana@php.net | Date: | Wed, 21 Nov 2007 14:55:02 +0000 |
| Subject: | #42957 [Ana->Bgs]: Inconsistent line numbering | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-232@lists.php.net to get a copy of this message | ||
ID: 42957
Updated by: vrana@php.net
Reported By: felipensp at gmail dot com
-Status: Analyzed
+Status: Bogus
Bug Type: Documentation problem
Operating System: Linux
PHP Version: 5.2.4
New Comment:
"A tick is an event that occurs for every N low-level statements
executed by the parser within the declare block." First tick occurs
after $i = 0;, last one after }.
Previous Comments:
------------------------------------------------------------------------
[2007-10-31 10:47:12] jani@php.net
It's because ticks are counted from "line 0" (declare) and they end at
} which is also counted in. This needs some better documenting.
------------------------------------------------------------------------
[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