|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63612 Line numbers not generated correctly without curly braces
Submitted: 2012-11-26 15:40 UTC Modified: 2021-02-23 15:46 UTC
Avg. Score:4.7 ± 0.7
Reproduced:10 of 10 (100.0%)
Same Version:3 (30.0%)
Same OS:2 (20.0%)
From: dave at behance dot com Assigned: cmb (profile)
Status: Feedback Package: Scripting Engine problem
PHP Version: 5.* OS: *
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-11-26 15:40 UTC] dave at behance dot com
While using Xdebug I noticed that it would say I had code coverage for lines that 
I did not. After some digging in their bug tracker I found that it appears to be 
due to a bug here. If there is an if statement without curly braces, it will not 
report two lines as such.

I saw issue #57110, but it looks like the guy didn't find out the actual reason 
xdebug wasn't working so it was marked as "not a bug"

Test script:
// Upon compiling it will only show one line
if ( false )
  echo "Hit this line"

Or even better...

Expected result:
I expect it to count as two separate lines since there's an actual linebreak.

Actual result:
It only counts one line internally


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-26 21:54 UTC] dave at behance dot com
Just tested on 5.4.6-2 and behavior appears to be the same
 [2012-11-27 02:16 UTC]
-Package: Testing related +Package: Scripting Engine problem
 [2013-10-24 06:44 UTC]
-Package: Scripting Engine problem +Package: Xdebug
 [2014-01-12 17:48 UTC]
-Package: Xdebug +Package: Scripting Engine problem
 [2014-01-12 17:48 UTC]
This is not an Xdebug issue, but a PHP scripting engine one.
 [2014-08-24 13:05 UTC] Aving426 at armyspy dot com
This bug happens on all major OSs (MacOS X, Windows, various Linux distribtions) and is independent from the PHP version (5.3 up to 5.6).

So PHP Version and OS should be set to Irrelevant.
 [2014-08-26 08:57 UTC]
-Operating System: Ubuntu +Operating System: * -PHP Version: 5.3.19 +PHP Version: 5.*
 [2021-02-23 15:46 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-02-23 15:46 UTC]
It seems to me that has been resolved in the meantime[1], or is
this still an issue with any of the actively supported PHP

[1] <>
[2] <>
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Mar 02 14:01:23 2021 UTC