3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Doll { function __invoke(); } class LargeDoll implements Doll { private $inner; function __construct(Doll $inner) { $this->inner = $inner; } function __invoke() { return ($this->inner)() . ' world'; } } class SmallDoll implements Doll { function __invoke() { return 'hello'; } } $russian = new LargeDoll(new SmallDoll()); var_dump($russian());

preferences:
23.95 ms | 404 KiB | 5 Q