Mantis - Quercus
Viewing Issue Advanced Details
3355 block always 02-24-09 15:41 02-24-09 17:24
koreth  
nam  
normal  
closed 4.0.0  
fixed  
none    
none 4.0.0  
0003355: Modifications to strings persist across requests in compiled mode
<?php
function foo(&$str) {
  $str[0] = 'a';
}
function bar() {
  $str = 'xyz';
  print $str;
  foo($str);
}
bar();

This prints "xyz" the first time it's loaded in compiled mode, but "ayz" thereafter.

Notes
(0003835)
koreth   
02-24-09 15:54   
Actually I am wrong: it prints "xyz" when it initially loads in interpreted mode, but the modified string gets compiled into the .java file:

  static final com.caucho.quercus.env.StringBuilderValue qv_ayz_2
    = new StringBuilderValue("ayz");
(0003836)
nam   
02-24-09 17:24   
php/374d