Skip to content
This repository has been archived by the owner on Feb 27, 2020. It is now read-only.

Wrong line numbers #23

Open
pierrocknroll opened this issue Aug 1, 2016 · 5 comments
Open

Wrong line numbers #23

pierrocknroll opened this issue Aug 1, 2016 · 5 comments

Comments

@pierrocknroll
Copy link

pierrocknroll commented Aug 1, 2016

Hi,

The line numbers in the logs are all wrong (approximatly 30 lines less).

#### /blabla.ph
* foreachByReference
 * Line 195: `    foreach ($aStats as $sKey => &$mValue)`

This foreach is in line 235, not 195.

@Alexia
Copy link
Owner

Alexia commented Aug 1, 2016

I would need an example file that causes the issue to properly investigate this.

@pierrocknroll
Copy link
Author

https://dl.dropboxusercontent.com/u/11081723/test.php

# nuance
#### /home/pmartel/test.php
* funcGetArg
 * Line 19: `  $a = func_get_arg(0);`
 * Line 21: `  var_dump($a, func_get_arg(0), func_get_args());`
* foreachByReference
 * Line 26: `foreach ($aTab as $sKey => &$sValue) {`
 * Line 33: `foreach ($aTab2 as &$sValue2) {`
 * Line 40: `foreach ($array as &$val) {`

@AndrzejFR
Copy link

Empty lines are not counted.
That will be because of FILE_SKIP_EMPTY_LINES flag here

$lines = file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);

@mbomb007
Copy link

mbomb007 commented Feb 1, 2019

Bump. This needs to be fixed. Just get rid of the flag. Otherwise, skip printing the line number. Better to not have it than to print it wrong every time.

@pierrocknroll
Copy link
Author

Pfiou. Forget it I'm afraid.
This project was when PHP7 was released.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants