- var_dump: documentation ( source)
<?php
function registerCallback(callable $method) {
// do something with $method
var_dump($method);
}
class A {
public function __construct() {
registerCallback([$this, "cb"]);
}
public function cb() {
// do somethin upon being invoked
}
}
new A();