From:             soham dot mehta at gmail dot com
Operating system: x86_64 GNU/Linux
PHP version:      5.2.10
PHP Bug Type:     PCRE related
Bug description:  preg_match incorreclty matching vertical tab character

Description:
------------
In preg_match (and preg_replace), vertical tab character matches
characters other than itself. At the least, it matches ascii 10,11,12,13
and 133, when it should only match 11.

(Vertical tab has been nixed from PCRE - is that the cause?)

Reproduce code:
---------------
        $wrong = chr(133); //can use any of 10,12,13 or 133
        $x = preg_match('/\v/', $wrong, $matches, PREG_OFFSET_CAPTURE);
        var_dump($matches);

        $right = chr(11);
        $x = preg_match('/\v/', $right, $matches, PREG_OFFSET_CAPTURE);
        var_dump($matches);


Expected result:
----------------
array
  empty

array
  0 => 
    array
      0 => string '' (length=1)
      1 => int 0


Actual result:
--------------
array
  0 => 
    array
      0 => string '�' (length=1)
      1 => int 0

array
  0 => 
    array
      0 => string '' (length=1)
      1 => int 0


-- 
Edit bug report at http://bugs.php.net/?id=49384&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=49384&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=49384&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=49384&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=49384&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=49384&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=49384&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=49384&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=49384&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=49384&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=49384&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=49384&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=49384&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=49384&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=49384&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=49384&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=49384&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=49384&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=49384&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=49384&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=49384&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=49384&r=mysqlcfg

Reply via email to