ID:               37911
 Updated by:       [EMAIL PROTECTED]
 Reported By:      thomas dot kalka at gmail dot com
-Status:           Assigned
+Status:           Closed
 Bug Type:         PCRE related
 Operating System: xubuntu
 PHP Version:      5.1.4
 Assigned To:      andrei
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2006-06-25 21:22:05] thomas dot kalka at gmail dot com

Description:
------------
unfortunately preg_replace_callback does not handle named groups


Reproduce code:
---------------
<?php

$a = "bla blub blah";

$regex = '|(?P<name>blub)|';

function callback($match) { var_dump($match); return '-'; }

preg_replace_callback($regex,'callback',$a);

$m = array(); preg_match($regex,$a,$m); var_dump($m);

?>

Expected result:
----------------
array(3) {
  [0]=>
  string(4) "blub"
  ["name"]=>
  string(4) "blub"
  [1]=>
  string(4) "blub"
}
array(3) {
  [0]=>
  string(4) "blub"
  ["name"]=>
  string(4) "blub"
  [1]=>
  string(4) "blub"
}


Actual result:
--------------
array(2) {
  [0]=>
  string(4) "blub"
  [1]=>
  string(4) "blub"
}
array(3) {
  [0]=>
  string(4) "blub"
  ["name"]=>
  string(4) "blub"
  [1]=>
  string(4) "blub"
}


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37911&edit=1

Reply via email to