<?php
echo preg_replace_callback('~-([a-z])~', function ($match) {
//return strtoupper($match[1]);
var_dump($match);
}, 'hello-world');
?>
This is a modification on the Example #1 on http://php.net/manual/en/functions.anonymous.php . The var_dump within the anonymous function outputs this:
array(2) { [0]=> string(2) "-w" [1]=> string(1) "w" } helloorld
Anybody has an idea what may be going on?
Thanks.