From:
Operating system: MacOSX 10.6.5
PHP version: 5.3.4
Package: Regexps related
Bug Type: Bug
Bug description:Regexp can not be compiled
Description:
------------
Although one of my regular expressions was compiled smoothly with
php-5.3.3,
I get the following exception message with php-5.3.4:
Exception: preg_match(): Compilation failed: unknown option bit(s) set at
offset 0
Test script:
---------------
$symbol = "\xE2\x89\xA1";
$operands =
'a:3:{i:0;s:115:"/left\.operand'.$symbol.'(.?)(operand\.([^'.$symbol.']*)'.$symbol.'?([^'.$symbol.']*)?)?|right\.operand'.$symbol.'(.?)(operand\.([^'.$symbol.']*)'.$symbol.'?([^'.$symbol.']*)?)?/u";i:1;s:18:"left.operand'.$symbol.'â";i:2;N;}';
$op = unserialize( $operands );
$operand_pattern = $op[0];
$operand_index = $op[1];
$operand_matches = $op[2];
echo $operand_pattern, '<br />'.'<br / >';
echo $operand_index;
$operand_match = preg_match( $operand_pattern, $operand_index,
$operand_matches );
Expected result:
----------------
The string stored in the variable called 'operand_pattern' should be
compiled as a valid regular expression.
Actual result:
--------------
An exception is thrown.
--
Edit bug report at http://bugs.php.net/bug.php?id=53605&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53605&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53605&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=53605&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53605&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=53605&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53605&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=53605&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=53605&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=53605&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=53605&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=53605&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=53605&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=53605&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53605&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53605&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53605&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=53605&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=53605&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=53605&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=53605&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=53605&r=mysqlcfg