Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 201155

Summary: Step over (F6) problem without braces
Product: z_Archived Reporter: Fabio Z <znt.fabio>
Component: PDTAssignee: Michael Spector <spektom>
Status: CLOSED WONTFIX QA Contact: Sylvia Tancheva <silviya>
Severity: major    
Priority: P2 CC: assaf.almaz, gadi, vadim.p, zulus
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Fabio Z CLA 2007-08-24 19:08:44 EDT
Build ID: I20070517-1700

Steps To Reproduce:
1. Write this code

<?php
class MyClass
{
    public function Foo($value)
    {
        if ($value == true)        
            return true;
        else
            return false;    
    }
    
    public function Foo2($value)
    {
        if ($value)
            return true;
        else
            return false;    
    }
}

$obj = new MyClass();
echo($obj->Foo(true));
echo($obj->Foo2(true));
?>

2. Put a breakpoint on the line if ($value == true) of function Foo()

3. Run the debug, when it stop on the breakpoint press F6 (step over)

I'm expecting that the debug goes on the line return true; but if braces are missing it skip the line.
With

    if ($value == true)
    {
        return true;
    }

all works.

---

Another bug:

4. Put a breakpoint on the line if ($value) of function Foo2()

3. Run the debug, when it stop on the breakpoint press F6 (step over)

Here the debug never stops on the breakpoint, with or without braces.
If I evaluate the if it works as described for function Foo():

  if ($value == true)




More information:
Comment 1 Assaf Almaz CLA 2008-03-21 10:19:16 EDT
this bug could have its root cause in the Zend Debugger binary
Comment 2 Assaf Almaz CLA 2008-04-16 07:58:30 EDT
The root cause is the Zend Debugger binary which does not recognize correctly statements such as if, for that don't have open brackets {
Comment 3 Gadi Goldbarg CLA 2008-12-01 09:08:15 EST
Still relevant - changing version to 2.0.0
In addition:
If you use the code:
<?php
class MyClass
{
    public function Foo2($value)
    {
        if ($value)
            return true;
        else
            return false;
    }
}
$obj = new MyClass();
echo($obj->Foo2(false));
?>
Put a breakpoint on the else -> debugger would not stop at all (breakpoint is totally ignored)
Putting braces around the return false; makes it stop on the return statement.

[Sylvia Tancheva]
Comment 4 Gadi Goldbarg CLA 2008-12-01 11:28:02 EST
Raising priority
Comment 5 Vadim Punski CLA 2009-12-30 03:54:00 EST
Tested on 2.2.1SR1.
Still relevant, moving to 2.2.0M1
Comment 6 Dawid Pakula CLA 2020-01-09 17:11:49 EST
Problem is in Zend Debugger only. It also was abandoned.