- var_dump: documentation ( source)
<?php
class c {
/**
* @param integer $i
* @return mixed
*/
public function test($i) {
$self = $this;
$test2 = function($x) use(&$test2, $self) {
var_dump($x);
$x++;
if ($x < 10) {
$test2($x);
$self->test($x);
}
};
$test2($i);
return $i;
}
}
$t = new c();
$t->test(1);