3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Library code final readonly class Renderer { public function __construct(private string $name, private object $object) {} public function render(callable $formatter): string { return $formatter($this->name, $this->object); } } // My code $formatter = ucfirst(...);$formatter = ucfirst(...); echo (new Renderer('name', new stdClass()))->render($formatter);

preferences:
25.96 ms | 404 KiB | 5 Q