- var_dump: documentation ( source)
- constant: documentation ( source)
<?php
class Test {
public function get($what) {
return constant("self::" . $what);
}
}
class Test2 extends Test {
const OMG = 11;
}
$test = new Test();
var_dump($test->get("OMG"));
var_dump($test::OMG);