- var_dump: documentation ( source)
- preg_replace_callback: documentation ( source)
<?php
class Test
{
private $var = 1;
public function fun1(){
return $this->var++;
}
public function fun2(){
echo preg_replace_callback('/.*/', function($find){var_dump($find); return $this->fun1().$find[0];}, 't');
}
}
$t = new Test;
$t->fun2();
echo 3;