- str_repeat: documentation ( source)
<?php
class Foo
{
private $value;
public function __construct($value)
{
$this->value = $value;
}
public function Weeee()
{
$that = &$this;
return function() use ($that) {
return str_repeat($that->value, 1000);
};
}
}
$foo = new Foo('stuff');
$func = $foo->Weeee();
echo $func();