- ini_set: documentation ( source)
- error_reporting: documentation ( source)
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
class A {
private $func = null;
public function __construct($func) {
$this->func = $func;
}
public function exec() {
$this->func();
}
}
$a = new A(function() {
echo 'works';
});
$a->exec();