3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class CallableString { private string $foo; public function doFoo(callable $foo): void { $this->foo = $foo; var_dump($this->foo); } } $c = new CallableString(); $c->doFoo('CallableString::doFoo');

preferences:
84.43 ms | 404 KiB | 5 Q