| Summary: | Anonymous function inside a class method breaks the scope | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Kirill <kirill> | ||||||||||
| Component: | PDT | Assignee: | PHP Core <php.core-inbox> | ||||||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||||||
| Severity: | major | ||||||||||||
| Priority: | P3 | CC: | gadi, ganoro, gern_, kirill, petyo_tanchev, silviya, zhaozhongwei | ||||||||||
| Version: | unspecified | ||||||||||||
| Target Milestone: | --- | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Windows All | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Kirill
Created attachment 173542 [details]
Test for reproduction
Use this for test/reproduction.
Local variables $before and $after should not be displayed in Outline.
Created attachment 173547 [details]
Patch file.
Fixed. The patch is attached. Created attachment 173548 [details]
Unitest for the bug
Hi Kirill
Thanks for you patch!!
I have not noticed you also fixed this bug,I am trying to fix this too:)
After apply your patch:
class A {
public function Foo()
{
$before = 0;
$add = function ($x) {
return ($| + 1);//$x is not shown here when call CA
};
$after = 0;
}
}
And I will attach my patch,and I am not sure if my patch will cause other problem:)
Created attachment 173564 [details]
patch
my patch
*** Bug 319921 has been marked as a duplicate of this bug. *** Tested on 2.2.1.v20100829 Fixed |