Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001886 [Quercus] major always 07-19-07 18:28 07-20-07 08:19
Reporter rjc View Status public  
Assigned To sam
Priority normal Resolution fixed  
Status closed   Product Version 3.1.1
Summary 0001886: Assignments to function parameters cause local variables to be created which shadow the parameters ONLY IN COMPILED PHP
Description
In MediaWiki Parser.php, there is a function extractTagsAndParams with the following signature:

function extractTagsAndParams($elements, $text, &$matches, $uniq_prefix = ''){
                static $n = 1;
                $stripped = '';
                $matches = array();

as you can see, $matches is in fact, a variable array passed by reference. In interpreted mode, this works as expected and the array passed as a parameter is assigned an empty array.

In compiled mode, the line "$matches = array()" actually creates a new local variable with an empty array which shadows the $matches parameter. Any further modifications to $matches only effect the local copy.

I suspect this is because the Java scoping semantics are coming into play with the generated code.
Additional Information
Attached Files

- Relationships

- Notes
(0002120)
sam
07-20-07 08:19

This issue was fixed in 3.1.2. php/[03]44y
 

- Issue History
Date Modified Username Field Change
07-19-07 18:28 rjc New Issue
07-19-07 18:29 rjc Issue Monitored: rjc
07-20-07 08:16 sam Status new => assigned
07-20-07 08:16 sam Assigned To  => sam
07-20-07 08:19 sam Status assigned => closed
07-20-07 08:19 sam Note Added: 0002120
07-20-07 08:19 sam Resolution open => fixed
07-20-07 08:19 sam Fixed in Version  => 3.1.2


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker