Anonymous | Login | Signup for a new account | 12-17-2024 11:42 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Advanced Details [ Jump to Notes ] | [ View Simple ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0000607 | [Quercus] | minor | always | 12-31-05 05:59 | 01-03-06 20:46 | ||||
Reporter | bago | View Status | @0@ | ||||||
Assigned To | |||||||||
Priority | normal | Resolution | fixed | Platform | |||||
Status | closed | OS | |||||||
Projection | none | OS Version | |||||||
ETA | none | Fixed in Version | 3.0.18 | Product Version | |||||
Product Build | |||||||||
Summary | 0000607: func_get_args should copy the values and not use references! | ||||||||
Description |
http://www.php.net/func_get_args [^] "Note: This function returns a copy of the passed arguments only, and does not account for default (non-passed) arguments." |
||||||||
Steps To Reproduce |
<?php function mixedargs() { $args = func_get_args(); $args[0]['a'] = "byreference"; } $test = array('a'=>"byvalue"); mixedargs($test); print($test['a']); ?> in original php this output "byvalue", in quercus this output "byreference". Here is a patch (I still don't know very well the quercus codebase, maybe this is not correct, but it fixed my problem). Index: modules/quercus/src/com/caucho/quercus/lib/QuercusFunctionModule.java =================================================================== --- modules/quercus/src/com/caucho/quercus/lib/QuercusFunctionModule.java (revision 493) +++ modules/quercus/src/com/caucho/quercus/lib/QuercusFunctionModule.java (working copy) @@ -120,7 +120,7 @@ Value []args = env.getFunctionArgs(); if (0 <= index && index < args.length) - return args[index]; + return args[index].copy(); else { // XXX: warning return NullValue.NULL; @@ -137,7 +137,7 @@ ArrayValue result = new ArrayValueImpl(); for (int i = 0; i < args.length; i++) - result.append(args[i]); + result.append(args[i].copy()); return result; } |
||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed. 27 unique queries executed. |