3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Example { private function callback() { return "Test"; } public function doSomething() { return preg_replace_callback('/./', array($this, 'callback'), 'foo'); } } $e = new Example; echo $e->doSomething();

preferences:
39.98 ms | 402 KiB | 5 Q