|
Mantis - Quercus
|
|||||
| Viewing Issue Advanced Details | |||||
|
|
|||||
| ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
| 1886 | major | always | 07-19-07 18:28 | 07-20-07 08:19 | |
|
|
|||||
| Reporter: | rjc | Platform: | |||
| Assigned To: | sam | OS: | |||
| Priority: | normal | OS Version: | |||
| Status: | closed | Product Version: | 3.1.1 | ||
| Product Build: | Resolution: | fixed | |||
| Projection: | none | ||||
| ETA: | none | Fixed in Version: | 3.1.2 | ||
|
|
|||||
| 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. |
||||
| Steps To Reproduce: | |||||
| Additional Information: | |||||
| Relationships | |||||
| Attached Files: | |||||
| Notes | |||||
|
|
|||||
|
|
||||