Mantis - Quercus
Viewing Issue Advanced Details
2973 minor always 09-27-08 20:16 10-02-08 13:35
koreth  
nam  
normal  
closed 3.2.1  
fixed  
none    
none 3.2.1  
0002973: Call-time pass by reference returns screwy results from substr()
Found this one in some third-party code. The code is technically not really correct, but Quercus fails strangely:

<?php
$foo = "test me";
$bar = substr(&$foo, 3, 3);
print $bar;

Vanilla PHP prints "t m", and logs a warning about pass-by-reference. Quercus prints ".ca" which I suspect is really just random junk (though it seems to be the same junk every time I run the test.)

Notes
(0003477)
koreth   
09-27-08 20:16   
If you take away the "&" this returns the correct value in Quercus.
(0003486)
nam   
10-02-08 13:35   
php/0c4n