- var_dump: documentation ( source)
<?php
class Go {
public function if (bool $cond): Go {
return $this;
}
public function then(callable $func): Go {
return $this;
}
}
$go = (new Go)->if(5 > 3)->then(function () {echo 'YAY!';});
var_dump($go);