php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #53823
Patch bug53823.phpt revision 2012-02-25 09:53 UTC by robertbasic dot com at gmail dot com
revision 2012-02-24 23:35 UTC by robertbasic dot com at gmail dot com

Patch bug53823.phpt for PCRE related Bug #53823

Patch version 2012-02-25 09:53 UTC

Return to Bug #53823 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: robertbasic.com@gmail.com

--TEST--
Bug #53823 (preg_replace: * qualifier on unicode replace garbles the string)
--FILE--
<?php

function prc_callback($matches)
{
    return '';
}

        var_dump(preg_replace('/[^\pL\pM]*/iu', '', 'áéíóú'));
        var_dump(preg_replace('/[^\pL\pM]+/iu', '', 'áéíóú'));
        
        var_dump(preg_filter('/[^\pL\pM]*/iu', '', 'áéíóú'));
        var_dump(preg_filter('/[^\pL\pM]+/iu', '', 'áéíóú'));
        
        var_dump(preg_replace_callback('/[^\pL\pM]*/iu', "prc_callback", 'áéíóú'));
        var_dump(preg_replace_callback('/[^\pL\pM]+/iu', "prc_callback", 'áéíóú'));
        
?>
--EXPECT--
string(10) "áéíóú"
string(10) "áéíóú"
string(10) "áéíóú"
NULL
string(10) "áéíóú"
string(10) "áéíóú"
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 05:01:23 2019 UTC