- var_dump: documentation ( source)
- preg_replace_callback: documentation ( source)
- preg_replace: documentation ( source)
<?php
class x
{
function __construct($x){
$p = '$this->waa($0);';
var_dump(
preg_replace_callback('~.~', function($m){
return eval(
preg_replace('~\$(\d)~', 'm[$1]', $p)
);
}, 'wazaa')
);
}
function waa($t){ return '*'.$t.'*'; }
}
new x($x);