Breakpoint getting hit in wrong file...

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Breakpoint getting hit in wrong file...

Postby codeowl » March 26th, 2013, 6:27 am

Hey guys,

I found an issue, where when you have two or more projects in the one solution that have the same class, in the same namespace, and you set a breakpoint in the second project's class, it actually breaks into class in the first project instead, even when there is no breakpoint in the first project.

I have attached a sample solution that contains two projects, each project has two files: index.php and TestClass.php.
The TestClass is in a namespace and has a single static method.
The index.php has a single line of code that calls a static method in TestClass class.

index.php
Code: Select all
<?php
include('Classes\Vendor\TestClass.php');
echo Vendor\TestClass::test();
?>


TestClass.php
Code: Select all
<?php
namespace Vendor;

class TestClass
{
    public static function test() {
        return "PHPWebProject2 - Hello World!";
    }
}
?>


Steps to replicate the issue:
1) Put a break point in PHPWebProject2\Classes\Vendor\TestClass.php on the line:
Code: Select all
return "PHPWebProject2 - Hello World!";

in the test function.
2) Ensure there is no break points in PHPWebProject1
3) Right Click on PHPWebProject2 and select Debug\Start New Instance from the context menu.

You will see that the debugger breaks into PHPWebProject1, instead of PHPWebProject2.

Regards,

Scott
You do not have the required permissions to view the files attached to this post.
Last edited by codeowl on March 26th, 2013, 11:48 pm, edited 1 time in total.
codeowl
 
Posts: 51
Joined: February 10th, 2013, 10:05 am

Re: Breakpoint getting hit in wrong file...

Postby Miloslav Beno » March 26th, 2013, 11:35 pm

Hi Scott,

Thanks for reporting this and creating the test case! I was able to replicate it, it will be fixed.

Regards,
Miloslav
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 49 guests

cron

User Control Panel

Login

Who is online

In total there are 49 users online :: 0 registered, 0 hidden and 49 guests (based on users active over the past 5 minutes)
Most users ever online was 274 on March 29th, 2024, 5:28 am

Users browsing this forum: No registered users and 49 guests