- var_dump: documentation ( source)
<?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();