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