From: webmaster at adurosolutions dot com
Operating system: CentOs
PHP version: 5.2.9
PHP Bug Type: PCRE related
Bug description: (?{CODE}) pattern not recognized, won't compile expression
Description:
------------
The (?{CODE}) regular expression has been in Perl since <= 5.005, and
the PHP documentation for PCRE says that it's current as of 5.005. This
functionality does not appear to be functional in PHP 5.2.9.
Reproduce code:
---------------
<?
$pattern = '/^(?{ $d=0
})(?:\((?{$d++})|\)(?{$d--})(?(?{$d<0})(?!))|(?>[^()]*))*(?(?{$d!=0})(?!))$/';
$pattern_simple = '/^(?{$d=0})\(/';
$subject = '((I)(like(pie))!)';
echo "result: ".preg_match($pattern, $subject)."<br/>";
echo "result_simple: ".preg_match($pattern_simple, $subject)."<br/>";
?>
Expected result:
----------------
I'm not claiming that the regular expressions should produce a match,
but they should compile and be evaluated, and thus return either a 0 or
a 1.
Actual result:
--------------
Warning: preg_match() [function.preg-match]: Compilation failed:
unrecognized character after (? or (?- at offset 2 in __FILE__ on line
__LINE__
--
Edit bug report at http://bugs.php.net/?id=48432&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48432&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48432&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48432&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48432&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48432&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48432&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48432&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48432&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48432&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48432&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48432&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48432&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48432&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48432&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48432&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48432&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48432&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48432&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48432&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48432&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48432&r=mysqlcfg