php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33985 variable corruption in nested functions using extract()
Submitted: 2005-08-03 20:53 UTC Modified: 2005-08-04 09:06 UTC
From: mdpm2 at rohms dot com Assigned:
Status: Not a bug Package: Variables related
PHP Version: 4.4.0 OS: FreeBSD 4.5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
7 - 1 = ?
Subscribe to this entry?

 
 [2005-08-03 20:53 UTC] mdpm2 at rohms dot com
Description:
------------
This problem was introduced after PHP 4.3.6 (last known version where it wasn't reproducable) and is still present in 4.4.0

Functions are unable to reference passed variables if they are called within a parent function that executes:
  extract($GLOBALS,EXTR_REFS);

Prior to 4.4.0, referenced vars and globals would contain random other variable values; as of 4.4.0 they're NULL or 0.

I'm trying to develop some code to isolate the problem but my error appears within a function that is recursive, but even the first iteration of the function does not receive the variable values passed as arguments.  I have to assume this may be some issue with the way the compiler/optimizer handles the code during compilation.





Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-04 09:06 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

One report is enough..

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 08:01:29 2024 UTC