3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $b; function __construct() { $this->b = new B; } function __call($method, $args) { $this->b->$method(...$args); } } class B { function work($p1, $p2, $p3) { var_dump($p1, $p2, $p3); } } (new B)->work(1, 2, 3); (new A)->work(4, 5, 6); (new A)->not();

preferences:
34.01 ms | 402 KiB | 5 Q