Edit report at http://bugs.php.net/bug.php?id=54039&edit=1

 ID:                 54039
 Updated by:         [email protected]
 Reported by:        a at b dot c dot de
 Summary:            use() of static variables in lambda functions can
                     break staticness
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Windows XP
 PHP Version:        5.3.5
 Assigned To:        dmitry
 Block user comment: N
 Private report:     N

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------
[2011-04-08 12:02:10] [email protected]

Automatic comment from SVN on behalf of dmitry
Revision: http://svn.php.net/viewvc/?view=revision&revision=310050
Log: - Fixed bug #54358 (Closure, use and reference)
- Fixed bug #54039 (use() of static variables in lambda functions can
break staticness)

------------------------------------------------------------------------
[2011-02-21 08:34:59] [email protected]

The concatenation example indeed shows memory corruption, with invalid
free's and reads of freed data,

------------------------------------------------------------------------
[2011-02-19 03:29:30] a at b dot c dot de

The cited snapshot (the VC6 build, FYI) shows the correct behaviour for
the incrementing tests.



$v remains static in the string concatenation test as well, but there is
what is probably an additional issue at play there:



Outer function catenates 'b' onto $v to give b

Outer function catenates 'a' onto $v to give ba

Inner function reckons $v is b

Outer function catenates 'b' onto $v to give bab

Outer function catenates 'a' onto $v to give baba

Inner function reckons $v is X☼←

Outer function catenates 'b' onto $v to give X☼←☺b

Outer function catenates 'a' onto $v to give X☼←☺ba

Inner function reckons $v is  ↕←☺b

Outer function catenates 'b' onto $v to give  ↕←☺bab

Outer function catenates 'a' onto $v to give  ↕←☺baba

Inner function reckons $v is  ↕←☺bab

------------------------------------------------------------------------
[2011-02-18 13:59:28] [email protected]

For windows, the address will be
http://rmtools.php.net/snaps/5.3-ts-windows-vc9-x86/builds/php-5.3-ts-windows-vc9-x86-r308443.zip
(or similar for other compiler/thread safety combination)

------------------------------------------------------------------------
[2011-02-18 13:54:23] [email protected]

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

Bug #53958 is similar and is fixed in SVN.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=54039


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54039&edit=1

Reply via email to