Mantis - Quercus
Viewing Issue Advanced Details
1561 major always 01-17-07 03:38 01-17-07 12:42
obaltz  
nam  
normal  
closed 3.1.0  
duplicate  
none    
none  
0001561: Problem with back references to subpatterns in preg_match_all
When using a back reference within the pattern, the behaviour of preg_match_all differs from the original php implementation. The PEAR template engine (class HTML_Template_IT) doesn't work due to this bug. See attached file for a demonstration. The pattern used in the script is the same as used in the PEAR class.

The demo script contains the same pattern twice, firstly as a single-quoted, secondly as a double-quoted string. The original php implementation treats those differently, Quercus does not. Quercus always behaves as if it were double-quoted.
The original php interpreter outputs:

int(1)
array(1) {
  [0]=>
  array(3) {
    [0]=>
    string(60) "<!-- BEGIN testblock --> inside block <!-- END testblock -->"
    [1]=>
    string(9) "testblock"
    [2]=>
    string(14) " inside block "
  }
}

Quercus outputs:
int(0)
array(0) {
}
duplicate of 0001562closed sam Problem with back references to subpatterns in preg_match_all 

Notes
(0001722)
obaltz   
01-17-07 03:45   
I'm sorry, the file upload didn't work but the rest of the bug was saved. See 1562 for a version including the demo script.